Fix bug in the RPC server and add a cap to the number of DB requests in a group