Refactored request and response to remove throwing exceptions.