Added JSON-RPC code & unit test