Edit and delete functions for categories