Fix and improve json-rpc and add chec arity for json-rpc #105