         return NSURL(string: combinedPath, relativeToURL: self.dynamicType.baseUrl)
     }
     
-    public func dataTask(configureUrlRequest configureUrlRequest : ( (urlRequest : NSMutableURLRequest) -> Void)? = nil, completionHandler : (data : NSData?, urlResponse : NSURLResponse?, error : NSError?) -> Void ) -> NSURLSessionDataTask? {
+    public func dataTask(configureUrlRequest configureUrlRequest : ConfigureUrlRequestHandler? = nil, completionHandler : DataTaskCompletionHandler) -> NSURLSessionDataTask? {
         
         guard let url = self.buildUrl() else {
             // TODO: notify client?

            }
            urlRequest.setValue("application/json", forHTTPHeaderField: "Accept") // TODO: should this go before or after the calls closer to the client?
            
            }, completionHandler: { (data, urlResponse, error) -> Void in
                if data != nil
                {
                    do
                    {
                        if let jsonObject: AnyObject = try NSJSONSerialization.JSONObjectWithData(data!, options: [])
                        {
                            completionHandler(jsonObject: jsonObject, error: nil)
                        } else if let errorString = NSString(data: data!, encoding: NSUTF8StringEncoding) as? String
                        {
                            completionHandler(jsonObject: nil, error: NSError(domain: errorString, code: 0, userInfo: nil) )
                        } else
                        {
                            completionHandler(jsonObject: nil, error: NSError(domain: "Unknown error from request", code: 0, userInfo: nil) )
                        }
                    } catch let error as NSError
                    {
                        completionHandler(jsonObject: nil, error: error)
                    }
                } else
                {
                    completionHandler(jsonObject: nil, error: error)
                }
        })
    }


internal let SubclassShouldOverrideUrl : NSURL? = NSURL(string: "subclassShouldOverride://asdf")

public enum SuccessResult<T> {
    case Success(T)
    case Failure(NSError)
}

public typealias ConfigureUrlRequestHandler = (urlRequest : NSMutableURLRequest) -> Void
public typealias DataTaskCompletionHandler = (result : SuccessResult<NSData>, urlResponse : NSURLResponse?) -> Void
public typealias JsonTaskCompletionHandler = (result : SuccessResult<AnyObject>) -> Void

public protocol Route {
    static var baseUrl : NSURL? { get }
    
