 
             # make ajax request based on inputs from current loop element
             promises.push($.ajax(
-                type: "put"
-                crossDomain: true
-                contentType: "application/octet-stream"
-                url: "https://api-content.dropbox.com/1/files_put/sandbox/" + e.id + ".seed"
-                data: data
-                beforeSend: (xhr) ->
-                  xhr.setRequestHeader 'Authorization', 'Bearer ' + Sync.oauth.access_token
+                Sync.generateRequest
+                  request: "upload"
+                  filename: e.id
+                  dataType: "text"
+                  data: JSON.stringify(result[0])
               )
             )
 

          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) ->



          # Send it to my butt yo
          $.ajax(
            Sync.generateRequest
              request: "upload"
              filename: "meta"
              data: JSON.stringify(result[0])
          ).done (data) ->
            console.log("all done! Delete the queue")
            Sync.queue = {"Note": {}, "Notebook": {}}
