         }
     }
     
-    private func fetchEntity(entity: NSEntityDescription, withResourceID resourceID: Int, usingContext context: NSManagedObjectContext, shouldPrefetch: Bool) -> (NSManagedObject, NSError) {
+    private func fetchEntity(entity: NSEntityDescription, withResourceID resourceID: Int, usingContext context: NSManagedObjectContext, shouldPrefetch: Bool) -> (NSManagedObject?, NSError?) {
         
         let fetchRequest = NSFetchRequest(entityName: entity.name)
         

        
        let fetchRequest = NSFetchRequest(entityName: entity.name)
        
        // TODO: Move to "else" statement
        
        let defaultSortDescriptor = NSSortDescriptor(key: self.resourceIDAttributeName, ascending: true)
        
        fetchRequest.sortDescriptors = [defaultSortDescriptor]
        
        // add search parameters...
        
        // MARK: Predicate

        
        let predicateOperatorObject: AnyObject? = searchParameters![SearchParameter.PredicateOperator.toRaw()]
        
        let predicateOperatorNumber = predicateOperatorObject as? UInt
        
        let predicateOperator = NSPredicateOperatorType.fromRaw(predicateOperatorNumber!)
        
        if (predicateKey != nil) && (predicateOperator != nil) && (jsonPredicateValue != nil) {
            
            // validate operator
            
            if predicateOperatorNumber == NSPredicateOperatorType.CustomSelectorPredicateOperatorType.toRaw() {
                
                let response = ServerResponse(statusCode: ServerStatusCode.BadRequest, JSONResponse: nil)
                
