 
           # Send it to my butt yo
           $.ajax(
-            type: "put"
-            crossDomain: true
-            contentType: "application/octet-stream"
-            dataType: "json"
-            url: "https://api-content.dropbox.com/1/files_put/sandbox/meta.seed"
-            data: JSON.stringify(result[0])
-            beforeSend: (xhr) ->
-              xhr.setRequestHeader 'Authorization', 'Bearer ' + Sync.oauth.access_token
+            Sync.generateRequest
+              request: "upload"
+              filename: "meta"
+              data: JSON.stringify(result[0])
           ).done (data) ->
             console.log("all done! Delete the queue")
             Sync.queue = {"Note": {}, "Notebook": {}}

          console.log 'All files uploaded, uploading the meta file'

          $.ajax(
            type: "put"
            crossDomain: true
            contentType: "application/octet-stream"
            dataType: "json"
            url: "https://api-content.dropbox.com/1/files_put/sandbox/meta.seed"
            data: Sync.exportData()
            beforeSend: (xhr) ->
              xhr.setRequestHeader 'Authorization', 'Bearer ' + Sync.oauth.access_token
          ).done (data) ->
            console.log("all done! Delete the queue")
            Sync.queue = {"Note": {}, "Notebook": {}}
            Sync.saveQueue()


  connect: (fn) ->


                dbrequests[itemid].onsuccess = (e) =>
                  # Upload file to my butt.
                  $.ajax(
                    Sync.generateRequest
                      request: "upload"
                      filename: itemid
                      dataType: "text"
                      data: e.target.result
                  ).done (data) ->
                    deferred.resolve()

              when "download"
                # Download from my butt
                $.ajax(
                  Sync.generateRequest
                    request: "download"
                    filename: item[1]
                    dataType: "text"
                ).done (data) ->
                  # We now have to store the new data in the database.
                  trans = Sync.db.transaction(["notes"], "readwrite")
