refactored to include category in API
refactored refactoring