updates to error handling and rpc handling