Fix bug in the API where the categories are not added