 
   sockrooms.on "resolve/get_proposal", (socket, session, data) ->
     unless data.callback?
-      return socket.sendJSON "error", {error: "Missing 'callback' parameter"}
+      return sockrooms.handleError("Missing 'callback' parameter")
     schema.Proposal.findOne data.proposal, (err, proposal) ->
       response = {}
       unless utils.can_view(session, proposal)

          }, done

    ], (err, twinkles) ->
      return socket.sendJSON "error", {error: err} if err?
      socket.sendJSON "twinkles", {twinkles: twinkles}

  sockrooms.on "resolve/get_proposal_list", (socket, session, data) ->
    if not data?.callback?
      socket.sendJSON "error", {error: "Missing callback parameter."}
    else
      utils.list_accessible_documents(
        schema.Proposal, session, (err, proposals) ->


  sockrooms.on "resolve/post_twinkle", (socket, session, data) ->
    respond = (err, twinkle, proposal) ->
      return sockrooms.handleError(socket, err) if err?
      sockrooms.broadcast(
        "resolve/" + proposal.id,
        "twinkles",
