cat api refactored