clean up JSON that goes to the front end