     // REUSABLE DATA/API CALL METHOD
     //*****************************************************************
     
-    class func loadDataFromURL(url: URL, completion:@escaping (_ data: Data?, _ error: Error?) -> Void) {
+    static func loadDataFromURL(url: URL, completion: @escaping (_ data: Data?, _ error: Error?) -> Void) {
         
         let sessionConfig = URLSessionConfiguration.default
-        sessionConfig.allowsCellularAccess          = true
-        sessionConfig.timeoutIntervalForRequest     = 15
-        sessionConfig.timeoutIntervalForResource    = 30
+        sessionConfig.allowsCellularAccess = true
+        sessionConfig.timeoutIntervalForRequest = 15
+        sessionConfig.timeoutIntervalForResource = 30
         sessionConfig.httpMaximumConnectionsPerHost = 1
         
         let session = URLSession(configuration: sessionConfig)
         
-        // Use NSURLSession to get data from an NSURL
-        let loadDataTask = session.dataTask(with: url){ data, response, error in
-            if let responseError = error {
-                completion(nil, responseError)
-                
+        // Use URLSession to get data from an NSURL
+        let loadDataTask = session.dataTask(with: url) { data, response, error in
+            
+            guard error == nil else {
+                completion(nil, error!)
                 if kDebugLog { print("API ERROR: \(error!)") }
-                
-                // Stop activity Indicator
-                UIApplication.shared.isNetworkActivityIndicatorVisible = false
-                
-            } else if let httpResponse = response as? HTTPURLResponse {
-                if httpResponse.statusCode != 200 {
-                    let statusError = NSError(domain:"com.matthewfecher", code:httpResponse.statusCode, userInfo:[NSLocalizedDescriptionKey : "HTTP status code has unexpected value."])
-                    
-                    if kDebugLog { print("API: HTTP status code has unexpected value") }
-                    
-                    completion(nil, statusError)
-                    
-                } else {
-                    
-                    // Success, return data
-                    completion(data, nil)
-                }
+                return
             }
+            
+            guard let httpResponse = response as? HTTPURLResponse, 200...299 ~= httpResponse.statusCode else {
+                completion(nil, nil)
+                if kDebugLog { print("API: HTTP status code has unexpected value") }
+                return
+            }
+            
+            guard let data = data else {
+                completion(nil, nil)
+                if kDebugLog { print("API: No data received") }
+                return
+            }
+            
+            // Success, return data
+            completion(data, nil)
         }
         
         loadDataTask.resume()

    // Load local JSON Data
    //*****************************************************************
    
    class func getDataFromFileWithSuccess(success: (_ data: Data) -> Void) {
        
        if let filePath = Bundle.main.path(forResource: "stations", ofType:"json") {
            do {
                let data = try NSData(contentsOfFile:filePath,
                    options: NSData.ReadingOptions.uncached) as Data
                success(data)
            } catch {
                fatalError()
            }
        } else {
            print("The local JSON file could not be found")
        }
    }
    

                    success(data)
                }
            } else {
                guard let stationDataURL = URL(string: stationDataURL) else {
                    if kDebugLog { print("stationDataURL not a valid URL") }
                    success(nil)
                    return
                }
                
                loadDataFromURL(url: stationDataURL) { data, error in
                    success(data)
                }
            }
        }
