Server: fix handling of RPC requests