Added an RPC response factory method

Added an RPC error enum type
Changed RPC exceptions to be associated with enum type