Hope you will refacto it in future, and will return valid Object instead of string and allow Spring do all work about marshalling to json for you