Returning json instead of text