add getAllSubjectsforJSON function and cleanup JSON formatting for subjects