             if let res = result.finalResult as? [T] { results = res }
             completion?(results)
         }
-        performBlock { () -> Void in
+        performBlock {
             do {
                 try self.executeRequest(asyncRequest)
             } catch let error as NSError {

     
     */
    class func saveDataWithBlock(saveFunction: () -> Void) {
        mainThreadContext.performBlockAndWait { () -> Void in
            saveFunction()
            do { try self.mainThreadContext.save(); do {
                try self.mainThreadContext.parentContext?.save()

}

public extension NSManagedObjectContext {
    
    /**
     
     Must be used for creation, updating or deletion of instances of NSManagedObject subclasses in the background. All changed will be saved to all parent contexts as well
     
     - parameter saveFunction: The function will be called to perform changes. All changes must be done in the localContext which is passed to this function as a parameter
     
     - parameter completion: The function will be called on the Main thread once save operation finished. Can update UI here
     
     */
    
    func saveDataInBackground(saveFunction: (localContext: NSManagedObjectContext) -> Void, completion: (() -> Void)?) {
        let context = createChildContext(.PrivateQueueConcurrencyType)
        context.performBlock {
            saveFunction(localContext: context)
            switch context.hasChanges {
            case true: context.saveWithCompletion(completion)
