             
         case .Initial:
             
-            defer { self.state = .Loaded }
-            
             // fetch from cache
             do { try self.fetchedResultsController.performFetch() }
                 
             catch { fatalError("Could not fetch from managed object context. \(error)") }
             
-        case .Loaded: break
-        }
-        
-        // reset cursor
-        self.queryCursor = nil
-        
-        // fetch from server
-        self.store.search(.Query(query), resultsLimit: queryResultsLimit, zoneID: zoneID) { [weak self] (response: ErrorValue<([T], CKQueryCursor?)>) in
-            
-            guard let controller = self else { return }
-            
-            switch response {
-                
-            case let .Error(error):
-                
-                controller.event.didRefresh(error: error)
-                
-            case let .Value(_, cursor):
-                
-                controller.queryCursor = cursor
-                
-                controller.event.didRefresh(error: nil)
-            }
+            // set initial values
+            self.searchResults = self.fetchedResultsController.fetchedObjects as! [NSManagedObject]
+            
+            // send events
+            self.event.willChangeContent()
+            
+            for (index, _) in self.searchResults.enumerate() {
+                
+                self.event.didInsert(index: index)
+            }
+            
+            self.state = .Loaded
+            
+            fallthrough
+            
+        case .Loaded:
+            
+            // reset cursor
+            self.queryCursor = nil
+            
+            self.state = .Refreshing
+            
+            // fetch from server
+            self.store.search(.Query(query), resultsLimit: queryResultsLimit, zoneID: zoneID) { [weak self] (response: ErrorValue<([T], CKQueryCursor?)>) in
+                
+                guard let controller = self else { return }
+                
+                switch response {
+                    
+                case let .Error(error):
+                    
+                    controller.event.didRefresh(.Error(error))
+                    
+                    controller.state = .Loaded
+                    
+                case let .Value(results, cursor):
+                    
+                    // set cursor
+                    controller.queryCursor = cursor
+                    
+                    controller.event.didRefresh(.Value(results))
+                    
+                    controller.state = .Loaded
+                }
+            }
+            
+        case .Refreshing: return // ignore, already refreshing
+            
+        case .LoadingCursor: return // ignore, loading more
         }
     }
     

        // load more (for last row)
        if let _ = self.queryCursor where row == self.searchResults.count {
            
            // make request to load more
            self.store.search(.Query(query), resultsLimit: queryResultsLimit, zoneID: zoneID) { [weak self] (response: ErrorValue<([T], CKQueryCursor?)>) in
                
                guard let controller = self else { return }
                
                switch response {
                    
                case let .Error(error):
                    
                    controller.event.didLoadCursor(error: error)
                    
                case let .Value(_, cursor):
                    
                    controller.queryCursor = cursor
                    
                    controller.event.didLoadCursor(error: nil)
                }
            }
            
            return .Loading

    case Loading
}

public struct QueryResultsControllerEvent<T> {
    
    // Request Callback
    
    /// Informs the delegate that a search request has completed with the specified error (if any).
    public var didRefresh: (ErrorValue<[T]>) -> () = { (error) in }
    
    public var didLoadCursor: (ErrorValue<[T]>) -> () = { (error) in }
    
    // Change Notification Callbacks
    
    public var willChangeContent: () -> () = { }
    
    public var didChangeContent: () -> () = { }
    
    public var didInsert: ((index: Int) -> ()) = { (index) in }
    
