         })
     }
     
-    public func fetchEntity(name: String, resourceID: UInt, URLSession: NSURLSession? = nil, completionBlock: ((error: ErrorType?, managedObject: NSManagedObject?) -> Void)) -> NSURLSessionDataTask {
+    public func fetchEntity<T: NSManagedObject>(name: String, resourceID: UInt, URLSession: NSURLSession? = nil, completionBlock: ((ErrorValue<T>) -> Void)) -> NSURLSessionDataTask {
         
         let entity = self.managedObjectModel.entitiesByName[name]! as NSEntityDescription
         
+        let request = self.requestForFetchEntity(name, resourceID: resourceID)
+        
+        let session = URLSession ?? self.defaultURLSession
+        
+        let dataTask = session.dataTaskWithRequest(request, completionHandler: {[weak self] (data: NSData?, response: NSURLResponse?, taskError: NSError?) -> Void in
+            
+            if self == nil {
+                
+                return
+            }
+            
+            do {
+                
+                try self!.validateFetchResponse((data, response, taskError), forEntity: entity)
+            }
+            catch  {
+                
+                
+            }
+            
+        })!
+        
+        dataTask.resume()
+        
+        return dataTask
+        
+    }
+    func hey() {
+    
         return self.getResource(entity, withID: resourceID, URLSession: URLSession ?? self.defaultURLSession, completionBlock: { (error, jsonObject) -> Void in
             
             // error

        return dataTask
    }
    
    private func getResource(entity: NSEntityDescription, withID resourceID: UInt, URLSession: NSURLSession, completionBlock: ((error: ErrorType?, resource: [String: AnyObject]?) -> Void)) -> NSURLSessionDataTask {
        
        // build URL
        
        let request = self.requestForFetchEntity(entity.name!, resourceID: resourceID)
        
        let dataTask = URLSession.dataTaskWithRequest(request, completionHandler: { (data, response, error) -> Void in
            
            if error != nil {
                
                completionBlock(error: error, resource: nil)
                
                return
            }
            
            let httpResponse = response as! NSHTTPURLResponse
            
            // error codes
            
            if httpResponse.statusCode != ServerStatusCode.OK.rawValue {
                
                let errorCode = ErrorCode(rawValue: httpResponse.statusCode)
                
                if errorCode != nil {
                    
                    if errorCode == ErrorCode.ServerStatusCodeForbidden {
                        
                        let frameworkBundle = NSBundle(identifier: "com.colemancda.NetworkObjects")
                        let tableName = "Error"
                        let comment = "Description for ErrorCode.\(errorCode!.rawValue) for GET Request"
                        let key = "ErrorCode.\(errorCode!.rawValue).LocalizedDescription.GET"
                        let value = "Access to resource is denied"
                        
                        let customError = ErrorType(domain: NetworkObjectsErrorDomain, code: errorCode!.rawValue, userInfo: [NSLocalizedDescriptionKey: NSLocalizedString(key, tableName: tableName, bundle: frameworkBundle!, value: value, comment: comment)])
                        
                        completionBlock(error: customError, resource: nil)
                        
                        return
                    }
                    
                    completionBlock(error: errorCode!.toError(), resource: nil)
                    
                    return
                }
                
                // no recognizeable error code
                completionBlock(error: ErrorCode.InvalidServerResponse.toError(), resource: nil)
                
                return
            }
            
            // parse response...
            
            let jsonObject = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions()) as? [String: AnyObject]
            
            // invalid JSON response
            if jsonObject == nil {
                
                completionBlock(error: ErrorCode.InvalidServerResponse.toError(), resource: nil)
                
                return
            }
            
            // validate JSON
            if !self.validateJSONRepresentation(jsonObject!, forEntity: entity) {
                
                completionBlock(error: ErrorCode.InvalidServerResponse.toError(), resource: nil)
                
                return
            }
            
            // success
            completionBlock(error: nil, resource: jsonObject)
        })
        
        dataTask.resume()
        
        return dataTask
    }
    
    private func editResource(entity: NSEntityDescription, withID resourceID: UInt, changes: [String: AnyObject], URLSession: NSURLSession, completionBlock: ((error: ErrorType?) -> Void)) -> NSURLSessionDataTask {
        

    
    // MARK: - Requests
    
    /// Performs a search request on the server.
    ///
    /// - precondition: The supplied fetch request's predicate must be a ```NSComparisonPredicate``` or ```NSCompoundPredicate``` instance.
    ///
    final public func performSearch<T: NSManagedObject>(fetchRequest: NSFetchRequest, URLSession: NSURLSession? = nil, completionBlock: ((ErrorValue<[T]>) -> Void)) -> NSURLSessionDataTask {
        
