Error handling for rpc

- rpc error handling
- usage of req.body for POST requests
- patched up testing a bit