 
     if this.get("file")
       this.update(title, content)
-      Promise.resolve('update')
+      return Promise.resolve('update')
     else
       this.insert(title, content)
-      Promise.resolve('insert')
+      return Promise.resolve('insert')
 
   insert: (title, content) ->
     that = this


        Promise.resolve(response.result)

  update: (title, content, callback, caller) ->
    that = this
    gapi.client.load('drive', 'v2', ->
      that.gdrive.update(that.get("file").id, title, content, (file)->
        console.log("update file")
        console.log(file)
        that.set("file", file)

        callback(file, "update", caller)
        )
    )
})
GDriveView = Backbone.View.extend({
  el: '#gdrive'
  events:

      },
      'body': multipartRequestBody})

  update: (fileId, title, content) ->
    multipartRequestBody = this.requestBody(title, content)
    return gapi.client.request({
      'path': '/upload/drive/v2/files/' + fileId,
      'method': 'PUT',
      'params': {'uploadType': 'multipart'},
