change to new JSON format and check for array