better implementation of server error jsonrpc