 private let dexcomLatestGlucosePath = "/ShareWebServices/Services/Publisher/ReadPublisherLatestGlucoseValues"
 private let dexcomServerUS = "https://share1.dexcom.com"
 private let dexcomServerNonUS = "https://shareous1.dexcom.com"
+private let maxReauthAttempts = 2
 
 // TODO use an HTTP library which supports JSON and futures instead of callbacks.
 // using cocoapods in a playground appears complicated


                    let decoded = try? NSJSONSerialization.JSONObjectWithData(response.dataUsingEncoding(NSUTF8StringEncoding)!, options: NSJSONReadingOptions())
                    guard let sgvs = decoded as? Array<AnyObject> else {
                        throw ShareError.DataError(reason: "Failed to decode SGVs as array: " + response)
                    }

                    var transformed: Array<ShareGlucose> = []

        }
    }

    private func parseDate(wt: String) throws -> NSDate {
        // wt looks like "/Date(1462404576000)/"
        let re = try NSRegularExpression(pattern: "\\((.*)\\)", options: NSRegularExpressionOptions())
