Updated the API to use arrays instead of objects