Try to use more of the Spring MVC features, e.g. don't pass in a raw Request and Response objects. Instead, pass in `@RequestParam` variables and return what you want to be outputted to the client. This makes the code a lot simpler, cleaner, and testable.