         })
     }
     
-    public func deleteManagedObject(managedObject: NSManagedObject, URLSession: NSURLSession = NSURLSession.sharedSession(), completionBlock: ((error: NSError?) -> Void)) -> NSURLSessionDataTask {
+    public func deleteManagedObject(managedObject: NSManagedObject, URLSession: NSURLSession? = nil, completionBlock: ((error: NSError?) -> Void)) -> NSURLSessionDataTask {
         
         // get resourceID
         let resourceID = managedObject.valueForKey(self.resourceIDAttributeName) as! UInt
         
-        return self.deleteResource(managedObject.entity, withID: resourceID, URLSession: URLSession, completionBlock: { (httpError) -> Void in
+        return self.deleteResource(managedObject.entity, withID: resourceID, URLSession: URLSession ?? self.defaultURLSession, completionBlock: { (httpError) -> Void in
             
             if httpError != nil {
                 

        })
    }
    
    public func fetchEntity(name: String, resourceID: UInt, URLSession: NSURLSession = NSURLSession.sharedSession(), completionBlock: ((error: NSError?, managedObject: NSManagedObject?) -> Void)) -> NSURLSessionDataTask {
        
        let entity = self.managedObjectModel.entitiesByName[name]! as! NSEntityDescription
        
        return self.getResource(entity, withID: resourceID, URLSession: URLSession, completionBlock: { (error, jsonObject) -> Void in
            
            // error
            if error != nil {

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