modified categories controller and added validations and exceptions