Refactor Springapp controller to comply with SRP.
Added and refactor test cases to cover unit and integration tests.