Hope it would be changed and return valid Object relative to requirements in future pull-requests? If you have time - refactor it, to be sure that method return object and Spring transform it to json for you