     # CALLBACK
 
     if type.function(fn) then fn(
+      null,
       @user.exportModel(LIST)
       @user.exportModel(TASK)
       @user.exportModel(PREF)

  task_create: (model, fn) =>
    id = @sync.create(TASK, model)
    @broadcast 'task.create', model
    if type.function(fn) then fn(id)
    return id

  list_create: (model, fn) =>
    id = @sync.create(LIST, model)
    @broadcast 'list.create', model
    if type.function(fn) then fn(id)
    return id




class GuestSocket extends Socket

  events:
    user: ['auth']

  ###
   * GuestSocket
   *
   * This will handle a newly created socket and allow them to authenticate
   * themselves. There is a limited time to authenticate before the socket
   * will be automatically closed. This is done so that the server doesn't
   * have to handle any more sockets than it needs to.
   *
   * - socket (Jandal)
  ###

  constructor: (socket) ->
    super
    log 'A new guest has connected'
    @authenticated = false
    @authTimeout = setTimeout @timeout, TIMEOUT_AUTH


  ###
   * User Authentication
   *
   * The callback function will only be called if authentication is successful,
   * otherwise the socket will be instantly closed and an error message will be
   * sent back with it.
   *
   * - userId (int) : id of the user
   * - token (string) : login token
   * - fn (function) : callback
  ###

  user_auth: (@userId, token, fn) =>
    clearTimeout @authTimeout
