         
         // build URL
         
-        let resourcePath = entity.name!
-        
-        let resourceURL = self.serverURL.URLByAppendingPathComponent(resourcePath).URLByAppendingPathComponent("\(resourceID)")
-        
-        let request = NSMutableURLRequest(URL: resourceURL)
-        
-        request.HTTPMethod = "PUT"
-        
-        request.HTTPBody = NSJSONSerialization.dataWithJSONObject(changes, options: self.jsonWritingOption(), error: nil)
+        let request = self.requestForEditEntity(entity.name!, resourceID: resourceID, changes: changes)
         
         let dataTask = URLSession.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
             

        
        // build URL
        
        let resourcePath = entity.name!
        
        let resourceURL = self.serverURL.URLByAppendingPathComponent(resourcePath).URLByAppendingPathComponent("\(resourceID)")
        
        let request = NSMutableURLRequest(URL: resourceURL)
        
        request.HTTPMethod = "DELETE"
        
        let dataTask = URLSession.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
            

        
        // build URL
        
        let urlRequest = self.requestForSearchEntity(entity.name!, withParameters: parameters)
        
        let dataTask = URLSession.dataTaskWithRequest(urlRequest, completionHandler: { (data, response, error) -> Void in
            
