Fixing model relationships & defining new JSON structure