fixed cascade delete
Refactored error handling in the service