   * );
   ###
 
-  updateEvent: (calendarId, eventId, event, onSuccess, onError) ->
-    @sendRequest('/calendars/' + calendarId + '/events/' + eventId + '/', 'PATCH', event, onSuccess, onError)
+  updateEvent: (calendarId, eventId, event) ->
+    action = (resolve, reject) -> @sendRequest('/calendars/' + calendarId + '/events/' + eventId + '/', 'PATCH', event, resolve, reject)
+    new Promise(action.bind(@))
 
   ###*
   * Callback, when event updated.

  * @private
  ###

  sendRequest: (path, method, data, onSuccess, onError) ->
    getCookie = (name) ->
      nameEQ = name + "="
      ca = document.cookie.split(";")

  * );
  ###

  getCalendar: (id) ->
    action = (resolve, reject) -> @sendRequest('/calendars/' + id + '/', 'GET', 0, resolve, reject)
    new Promise(action.bind(@))

  ###*
  * Callback, returns particular calendar including its name and id. TODO: return custom fields here.
