         return body
     }
 
-    func synthesizeRequest(
+    public func synthesizeRequest(
         method:HTTPMethod,
         URLString:String,
         params:[String:AnyObject],

    }
}

extension Just {
    public class func delete(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        URLQuery:String? = nil,
        requestBody:NSData? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .DELETE,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout:timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public class func get(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        allowRedirects:Bool = true,
        cookies:[String:String] = [:],
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .GET,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout:timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public class func head(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .HEAD,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public class func options(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .OPTIONS,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public class func patch(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .OPTIONS,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public class func post(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .POST,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public class func put(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .PUT,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )
    }
}

public enum HTTPFile {
    case URL(NSURL,String?) // URL to a file, mimetype

    510: "not extended"                  ,
]

public protocol JustProtocol {
    func request(
        method:HTTPMethod,
        URLString:String,
        params:[String:AnyObject],
        data:[String:AnyObject],
        json:[String:AnyObject]?,
        headers:[String:String],
        files:[String:HTTPFile],
        auth:Credentials?,
        cookies: [String:String],
        redirects:Bool,
        timeout:Double?,
        URLQuery:String?,
        requestBody:NSData?,
        asyncProgressHandler:TaskProgressHandler?,
        asyncCompletionHandler:((HTTPResult!) -> Void)?) -> HTTPResult

    static var shared: Self { get }
}

extension JustProtocol {
    public static func delete(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        URLQuery:String? = nil,
        requestBody:NSData? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .DELETE,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout:timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public static func get(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        allowRedirects:Bool = true,
        cookies:[String:String] = [:],
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .GET,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout:timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public static func head(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .HEAD,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public static func options(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .OPTIONS,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public static func patch(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .OPTIONS,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public static func post(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .POST,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )

    }

    public static func put(
        URLString:String,
        params:[String:AnyObject] = [:],
        data:[String:AnyObject] = [:],
        json:[String:AnyObject]? = nil,
        headers:[String:String] = [:],
        files:[String:HTTPFile] = [:],
        auth:(String,String)? = nil,
        cookies:[String:String] = [:],
        allowRedirects:Bool = true,
        timeout:Double? = nil,
        requestBody:NSData? = nil,
        URLQuery:String? = nil,
        asyncProgressHandler:((HTTPProgress!) -> Void)? = nil,
        asyncCompletionHandler:((HTTPResult!) -> Void)? = nil
        ) -> HTTPResult {

            return Just.shared.request(
                .PUT,
                URLString: URLString,
                params: params,
                data: data,
                json: json,
                headers: headers,
                files:files,
                auth: auth,
                cookies: cookies,
                redirects: allowRedirects,
                timeout: timeout,
                URLQuery: URLQuery,
                requestBody: requestBody,
                asyncProgressHandler: asyncProgressHandler,
                asyncCompletionHandler: asyncCompletionHandler
            )
    }
}


public final class Just: NSObject, NSURLSessionDelegate, JustProtocol {
    private struct Shared {
        static let instance = Just()
    }

    public class var shared: Just { return Shared.instance }

    public init(session:NSURLSession? = nil, defaults:JustSessionDefaults? = nil) {
        super.init()
