 
 API message2
     event          : 'query'
-    desc           : "This queries directly the database (sort of Facebook's GraphQL)"
     fields:
         id:
              init  : undefined

#############################################

# client --> hub
API message
    event          : 'create_account'
    id             : undefined
    first_name     : required

API = (obj) ->
    # obj could be message version 1 or 2!
    exports.api_messages[obj.event] = true

###

API messages

These options appear on all API messages:
- event: the command to be executed, for example "ping"
- id: uuid for the API call, will be returned in response. If id not provided
  in the API message, a random id will be generated and returned in the response

Additional notes:
- Options with default of "undefined" may be omitted.
- A valid API key is required on all API calls, including ping.
- The structure of the response to each API message is given in the
  immediately following "message" object definition.
- Some API messages, for example "query" and "get_usernames", require
  options to be passed as a JSON object, as noted in message comments.
- If JSON is not required for API message options, it is still valid.
- If API message options are sent as JSON, the message must be sent with
  a request header of "Content-Type: application/json".

###

############################################
# Compute server messages
