refactored category API