move pri for jsonrpc
some refactoring