     
     public func createEntity(name: String, withInitialValues initialValues: [String: AnyObject]?, URLSession: NSURLSession = NSURLSession.sharedSession(), completionBlock: ((error: NSError?, managedObject: NSManagedObject?) -> Void)) -> NSURLSessionDataTask {
         
-        let entity = self.model.entitiesByName[name]! as NSEntityDescription
+        let entity = self.managedObjectModel.entitiesByName[name]! as NSEntityDescription
         
         var jsonValues: [String: AnyObject]?
         

        NSNotificationCenter.defaultCenter().removeObserver(self, name: NSManagedObjectContextDidSaveNotification, object: self.privateQueueManagedObjectContext)
    }
    
    public init(persistentStoreCoordinator: NSPersistentStoreCoordinator,
        managedObjectContextConcurrencyType: NSManagedObjectContextConcurrencyType = .MainQueueConcurrencyType,
        serverURL: NSURL,
        prettyPrintJSON: Bool = false,

                    
                    // get the entity
                    
                    let entities = self.managedObjectModel.entitiesByName as [String: NSEntityDescription]
                    
                    let entity = entities[resourcePath!]
                    
