       url   : url
       auth  : { type, key }
 
-  createKite: ({ kite: { name, url }, token }) ->
+  createKite: ({ kite: { name }, token, url }) ->
     new @constructor.Kite
       autoConnect : no
       name        : name

        callback new Error "No kite found!"
        return

      callback null, @kiteify result.kites
      return
    return



      callback null, { changes, watcherID }

      changes.emit 'register', kite for kite in @createKites kiteDescriptors

  cancelWatcher: (id, callback) ->
    @kite.tell 'cancelWatcher', [id], callback

  createUpdateHandler: (changes) -> (response) =>
    { err, result } = @kite.unwrapMessage response

    if err?
      changes.emit 'error', err
      return

    { action, kite, token, url } = result

    kite = @createKite { kite, token, url }

    eventName = @constructor.actions[action]
    changes.emit eventName, kite

  @actions      =
    REGISTER    : 'register'
    DEREGISTER  : 'deregister'
