     }
 
 
+    func reload() {
+        switch loadingState {
+            case .Reset:
+                connect()
+            case .Trying:
+                return
+            case .Loading:
+                return
+            case .Idle:
+                loadingState = IMSLoadingState.Loading([:])
+                loadIncidentTypes()
+        }
+    }
+
+
+    func createIncident(incident: Incident) -> Failable {
+        return Failable(Error("Unimplemented"))
+    }
+
+
+    func updateIncident(incident: Incident) -> Failable {
+        return Failable(Error("Unimplemented"))
+    }
+
+
+//    func reloadIncidentWithNumber(number: Int) -> Failable {
+//        return Failable(Error("Unimplemented"))
+//    }
+    
+    
     private func connect() {
         switch loadingState {
-            case .Reset:
-                break
-            default:
-                return
+        case .Reset:
+            break
+        default:
+            return
         }
 
         let pingURL = "\(self.url)ping/"

        group group: IMSLoadingGroup,
        id: IMSConnectionID,
        connection: HTTPConnection
    ) {
        guard case .Loading(var loading) = loadingState else {
            logError("Incorrect loading state.")
            return
        }

        if loading[group] == nil {
            loading[group] = [:]
        }

        loading[group]![id] = connection

        loadingState = IMSLoadingState.Loading(loading)
    }


    private func removeConnectionForLoadingGroup(
        group group: IMSLoadingGroup,
        id: IMSConnectionID
    ) {
        guard case .Loading(var loading) = loadingState else {
            logError("Incorrect loading state.")
            return
        }

        if loading[group] == nil {
            logError("No such connection.")
            return
        }

        if loading[group]!.removeValueForKey(id) == nil {
            logError("No such connection.")
            return
        }

        if loading[group]!.count == 0 {
            // Nothing left for this group; remove the group
            loading.removeValueForKey(group)

            if loading.count == 0 {
                // No groups loading data; switch to idle state
                loadingState = IMSLoadingState.Idle
                return
            }
        }

        loadingState = IMSLoadingState.Loading(loading)
    }


    private func loadIncidentTypes() {
        let typesURL = "\(self.url)incident_types/"

        func onResponse(json: AnyObject?) {
            logInfo("Loaded incident types")

            removeConnectionForLoadingGroup(
                group: IMSLoadingGroup.IncidentTypes,
                id: IMSConnectionID.IncidentTypes
            )

            guard let json = json else {
                logError("Incident types request retrieved no JSON data")
                return
            }

            guard let incidentTypes = json as? Array<String> else {
                logError("Incident Types JSON is non-conforming: \(json)")
                return
            }

            _incidentTypes = Set(incidentTypes)
        }

        func onError(message: String) {
            logError("Error while attempting incident types request: \(message)")
            resetConnection()
        }

        logInfo("Sending incident types request to: \(typesURL)")

        guard let connection = self.httpSession.sendJSON(
            url: typesURL,
            json: nil,
            responseHandler: onResponse,
            errorHandler: onError
        ) else {
            logError("Unable to create incident types connection?")
            resetConnection()
            return
        }

        addConnectionForLoadingGroup(
            group: IMSLoadingGroup.IncidentTypes,
            id: IMSConnectionID.IncidentTypes,
            connection: connection
        )
    }


    func reload() {
        switch loadingState {
            case .Reset:
                connect()
            case .Trying:
                return
            case .Loading:
                return
            case .Idle:
                loadingState = IMSLoadingState.Loading([:])
                loadIncidentTypes()
        }
    }


    func createIncident(incident: Incident) -> Failable {
        return Failable(Error("Unimplemented"))
    }


    func updateIncident(incident: Incident) -> Failable {
        return Failable(Error("Unimplemented"))
    }


//    func reloadIncidentWithNumber(number: Int) -> Failable {
//        return Failable(Error("Unimplemented"))
//    }

}



            json: nil,
            responseHandler: onResponse,
            errorHandler: onError
            ) else {
                logError("Unable to create ping connection?")
                resetConnection()
                return
        }

        loadingState = IMSLoadingState.Trying(connection)
