Add error message
Refactor categories controller