Properly implemented the service with error handling.