Changed category and sub_category to categories and sub_categories (array)