API rewritten to JSONRPC2