Updated getAllCategories method signature