 
 extension JSON: RawRepresentable {
     
-    enum JSONDataError: ErrorType {
-        case ObjectMissing
-        case InvalidJSONObject
+    enum DataError: ErrorType {
+        case MissingObject
+        case InvalidObject
     }
     
     public init?(rawValue: AnyObject) {
         guard NSJSONSerialization.isValidJSONObject(rawValue) else {
-            self.init()
-            
-            return
+            return nil
         }
         
         self.init(rawValue)

        return self.object ?? NSNull()
    }
    
    public func rawData(options: NSJSONWritingOptions = NSJSONWritingOptions(rawValue: 0)) throws -> NSData {
        guard let object = object else {
            throw JSONDataError.ObjectMissing
        }
        
        guard NSJSONSerialization.isValidJSONObject(object) else {
            throw JSONDataError.InvalidJSONObject
        }
        
        return try NSJSONSerialization.dataWithJSONObject(object, options: options)


public struct JSON {
    
    private var object: AnyObject?
    
    public init() {
        self.object = nil
