 //
-//  URLFetcher.swift
+//  JSONClient.swift
 //  Purchases
 //
 //  Created by Michael Tremel on 6/15/15.

        request.addValue("application/json", forHTTPHeaderField: "Accept")
        
        UIApplication.shared().isNetworkActivityIndicatorVisible = true

        URLSession.shared.dataTask(with: request, completionHandler: completionHandler).resume()
        
        UIApplication.shared().isNetworkActivityIndicatorVisible = false

    }
    
    class func post(_ url: String, body: String) {

    class func get(_ url: String, callback: ((AnyObject) -> Void)) {
        basicRequest(url, method: "GET", body: "") { (data, response, error) in
            do {
                UIApplication.shared().isNetworkActivityIndicatorVisible = false
                
                if let json = data {
                    let parsed = try JSONSerialization.jsonObject(with: json, options: JSONSerialization.ReadingOptions.allowFragments)
                    callback(parsed)
