                 if statusCode == 200 {
                     if let urlString = jsonObj["data"]!["url"]! as? String {
                         if let url = NSURL(string: urlString) {
-                            successBlock(url)
+                            success(url)
                         }
                     }
-                } else {
-                    failureBlock(statusCode)
                 }
             } else {
                 print(error?.localizedDescription)

    let pasteboard = LFPasteboard()
    //---------------------------------------------------------------------------
    func share() {
        uploadString(pasteboard.extractData())
    }
    //---------------------------------------------------------------------------
    func shortenURL(URL: String, successBlock:(NSURL?)->(), failureBlock:(Int)->() = {_ in }) {
        /// Bit.ly parameters
        let bitlyAPIurl = "https://api-ssl.bitly.com"
        let bitlyAPIshorten = bitlyAPIurl + "/v3/shorten?access_token=" + bitlyOAuth2Token + "&longUrl=" + URL
        let url: NSURL! = NSURL(string: bitlyAPIshorten)
        //---------------------------------------------------------------------------
        session.dataTaskWithURL(url) { (data, response, error) in

        //---------------------------------------------------------------------------
    }
    //---------------------------------------------------------------------------
    func uploadTextData(string: String, fileName: String = "Casted.swift", isPublic: Bool = true, success:(NSURL)->()) {
        //TODO: Add GitHub login support
        let content = [
            "description": "Generated with Cast (www.castshare.io)",
            "public": true,
            "files":
                [fileName:
                    ["content": string]
