Improve error handling in web services.