Added unit tests and refactored the Request and Response objects