Update rpc.rb

Return 500 error in error hash to give a consistent output.