     func server(server: Server, didEncounterInternalError error: NSError, forRequest request: ServerRequest, userInfo: [ServerUserInfoKey: AnyObject])
     
     /** Asks the delegate for a status code for a request. Any response that is not ServerStatusCode.OK, will be forwarded to the client and the request will end. This can be used to implement authentication or access control. */
-    func server(server: Server, statusCodeForRequest request: ServerRequest, managedObject: NSManagedObject?) -> ServerStatusCode
+    func server(server: Server, statusCodeForRequest request: ServerRequest, managedObject: NSManagedObject?, context: NSManagedObjectContext?) -> ServerStatusCode
     
     /** Notifies the delegate that a request was performed successfully. */
     func server(server: Server, didPerformRequest request: ServerRequest, withResponse response: ServerResponse, userInfo: [ServerUserInfoKey: AnyObject])

        // ask delegate
        if self.delegate != nil {
            
            let statusCode = self.delegate?.server(self, statusCodeForRequest: request, managedObject: nil)
            
            if statusCode != ServerStatusCode.OK {
                

        // ask delegate for access
        if delegate != nil {
            
            let statusCode = self.delegate?.server(self, statusCodeForRequest: request, managedObject: managedObject, context:context)
            
            if statusCode != ServerStatusCode.OK {
                
