 
 let BRAPIClientErrorDomain = "BRApiClientErrorDomain"
 
-typealias URLSessionTaskHandler = (NSData?, NSHTTPURLResponse?, NSError?) -> Void
-typealias URLSessionChallengeHandler = (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void
+public typealias URLSessionTaskHandler = (NSData?, NSHTTPURLResponse?, NSError?) -> Void
+public typealias URLSessionChallengeHandler = (NSURLSessionAuthChallengeDisposition, NSURLCredential?) -> Void
 
 extension String {
     static var urlQuoteCharacterSet: NSCharacterSet {

    
    // MARK: URLSession Delegate
    
    func URLSession(session: NSURLSession, didBecomeInvalidWithError error: NSError?) {
        log("URLSession didBecomeInvalidWithError: \(error)")
    }
    
    func URLSession(session: NSURLSession, task: NSURLSessionTask, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: URLSessionChallengeHandler) {
            log("URLSession task \(task) didReceivechallenge \(didReceiveChallenge.protectionSpace)")
            
    }
    
    func URLSession(session: NSURLSession, didReceiveChallenge: NSURLAuthenticationChallenge, completionHandler: URLSessionChallengeHandler) {
        log("URLSession didReceiveChallenge \(didReceiveChallenge)")
        // handle HTTPS authentication
        if didReceiveChallenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust {

        task.resume()
    }
    
    public func me() {
        let req = NSURLRequest(URL: url("/me"))
        let task = dataTaskWithRequest(req, authenticated: true) { (data, resp, err) -> Void in
            if let data = data {
