             }
 
             components.queryItems = [
-                NSURLQueryItem(name: "sessionId", value: token),
+                NSURLQueryItem(name: "sessionId", value: self.token),
                 NSURLQueryItem(name: "minutes", value: String(1440)),
                 NSURLQueryItem(name: "maxCount", value: String(n))
             ]

    }

    public func fetchLast(n: Int, callback: (ShareError?, [ShareGlucose]?) -> Void) {
        ensureToken() { (error, token) in
            guard error == nil, let token = token else {
                return callback(error, nil)
            }



                    let decoded = try? NSJSONSerialization.JSONObjectWithData(response.dataUsingEncoding(NSUTF8StringEncoding)!, options: NSJSONReadingOptions())
                    guard let sgvs = decoded as? Array<AnyObject> else {
                        if remaining > 1 {
                            self.token = nil
                            return self.fetchLastWithRetries(n, remaining: remaining - 1, callback: callback)
                        } else {
                            throw ShareError.DataError(reason: "Failed to decode SGVs as array after trying to reauth: " + response)
                        }
                    }

                    var transformed: Array<ShareGlucose> = []
