starting to json for data instead of directly in the controller