Add RPC server thread support and client test cases