   * );
   ###
 
-  addEvent: (calendarId, event, onSuccess, onError) ->
-    @sendRequest('/calendars/' + calendarId + '/events/', 'POST', event, onSuccess, onError)
+  addEvent: (calendarId, event) ->
+    action = (resolve, reject) -> @sendRequest('/calendars/' + calendarId + '/events/', 'POST', event, resolve, reject)
+    new Promise(action.bind(@))
+
+  addEvents: (calendarId, events) ->
+    action = (resolve, reject) ->
+      numEvents = events.length
+      count = 0
+      i = 0
+      while i < numEvents
+        @addEvent(calendarId, events[i])
+        .then (args) ->
+          count++
+          if count >= numEvents
+            resolve()
+        , (err) ->
+          count++
+          if count >= numEvents
+            reject()
+        i++
+      return
+    new Promise(action.bind(@))
 
   ###*
   * Callback, executed when event added successfully.

        data += chunk
      )
      res.on('end', () ->
        if (('' + res.statusCode).match(/^2\d\d$/))
        # Request handled, happy
          if onSuccess
            parsed = {}
            if data.length != 0
              parsed = JSON.parse(data)

            if parsed.constructor is Array
              for k,v of parsed
                if v.hasOwnProperty('start')
                  v.start = new Date(v.start)

                if v.hasOwnProperty('end')
                  v.end = new Date(v.end)

                if v.hasOwnProperty('lastUpdate')
                  v.lastUpdate = new Date(v.lastUpdate)
            else
                if parsed.hasOwnProperty('start')
                  parsed.start = new Date(parsed.start)

                if parsed.hasOwnProperty('end')
                  parsed.end = new Date(parsed.end)

                if parsed.hasOwnProperty('lastUpdate')
                  parsed.lastUpdate = new Date(parsed.lastUpdate)

            onSuccess(res, parsed)
        else
          # Server error, I have no idea what happend in the backend
          # but server at least returned correctly (in a HTTP protocol
          # sense) formatted response
          if onError then onError(res, data) else console.error(res)
      )
    )


  * );
  ###

  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.
