flattened out the json so that it is easier to work with
flattened out JSON to fix the front end