Initial work for a jsonrpc api