Initial implementation of server message handling

Decodes and dispatches messages in the API server, but actual
operations are only stubs. Does not yet catch and pass errors back to
the client.