Add partial json rpc support. Need to review serialization.