Created a response object which handles the errors.

- Probably not the best place but will refactor later.