                 
                 return (response, userInfo)
             }
+        }
+        
+        // perform Core Data validation (to make sure there will be no errors saving)
+        
+        var validCoreData: Bool = false
+        
+        context.performBlockAndWait({ () -> Void in
+            
+            validCoreData = managedObject!.validateForDelete(nil)
+        })
+        
+        // invalid (e.g. non-optional property is nil)
+        if !validCoreData {
+            
+            let response = ServerResponse(statusCode: ServerStatusCode.BadRequest, JSONResponse: nil)
+            
+            return (response, userInfo)
         }
         
         // delete...

            return
        })
        
        let response = ServerResponse(statusCode: ServerStatusCode.OK, JSONResponse: nil)
        
        return (response, userInfo)

        
        var editError: NSError?
        
        // validate and convert JSON
        context.performBlockAndWait({ () -> Void in
            
            editStatusCode = self.verifyEditResource(managedObject!, forRequest: request, context: context, newValues: &newValues, error: &editError)
