added serialization code for Request
added error codes for responses. added serialization for result objects and their fields and for error codes