         
         NetworkController.task(httpRequest, completion: { (data, error) -> Void in
             var err: NSError?
-            let jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: nil, error: &err) as NSArray
-            
-            var palettes: [AnyObject] = []
-            for obj in jsonResult {
-                if let paletteObj = obj as? NSDictionary {
-                    palettes.append(paletteObj)
-                }
-            }
+            let jsonResult = NSJSONSerialization.JSONObjectWithData(data, options: nil, error: &err) as [AnyObject]
+            let palettes = jsonResult.filter({ (obj: AnyObject) -> Bool in
+                return (obj is NSDictionary)
+            })
             
             context.performBlockAndWait(){
                 let childContext = NSManagedObjectContext(concurrencyType: .PrivateQueueConcurrencyType)

        
        var error: NSError? = nil
        let privateContext = self.backingManagedObjectContext
        privateContext.performBlockAndWait(){
            if let results = privateContext.executeFetchRequest(fetchRequest, error: &error) {
                backingObjectId = results.last as? NSManagedObjectID
            }

            cacheFetchRequest.resultType = .ManagedObjectResultType
            cacheFetchRequest.propertiesToFetch = [kPALResourceIdentifierAttributeName]
            
            let results = backingContext.executeFetchRequest(cacheFetchRequest, error: &error)! as NSArray
            let resourceIds = results.valueForKeyPath(kPALResourceIdentifierAttributeName) as [NSString]
            
            let managedObjects = resourceIds.map({ (resourceId: NSString) -> NSManagedObject in
                let objectId = self.objectIDForEntity(fetchRequest.entity!, withResourceIdentifier: resourceId)
                let managedObject = context.objectWithID(objectId!) as Palette
                
                let predicate = NSPredicate(format: "%K = %@", kPALResourceIdentifierAttributeName, resourceId)
                let backingObj = results.filteredArrayUsingPredicate(predicate!).first as Palette
                
                managedObject.transform(palette: backingObj)
                return managedObject
            })
            
            return managedObjects
        }
        else if fetchRequest.resultType == .ManagedObjectIDResultType {
            let objectIds = backingContext.executeFetchRequest(fetchRequest, error: &error)
