backend: Fix the RPC impl and tests