     private func loadLocations() {
         let locationsURL = "\(self.url)locations/"
 
-        func onResponse(headers: HTTPHeaders, json: AnyObject?) {
+        func removeConnection() {
             removeConnectionForLoadingGroup(
                 group: IMSLoadingGroup.Locations,
                 id: IMSConnectionID.Locations
             )
-
+        }
+        
+        func onResponse(headers: HTTPHeaders, json: AnyObject?) {
+            defer { removeConnection() }
+            
             guard let json = json else {
                 logError("Locations request retrieved no JSON data")
                 return

                loadIncident(number: number, etag: etag)
            }

            removeConnection()

            logHTTP("Loaded incident list")
        }

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

        logHTTP("Sending incident list request to: \(incidentsURL)")

            if loadedEtag == etag { return }
        }

        func removeConnection() {
            if !solo {
                removeConnectionForLoadingGroup(
                    group: IMSLoadingGroup.Incidents,
                    id: IMSConnectionID.Incidents(number)
                )
            }
        }
            
        func onResponse(headers: HTTPHeaders, json: AnyObject?) {
            defer { removeConnection() }

            let incident: Incident
            do { incident = try readIncident(json: json, expectedNumber: number) }
