Add server error handling mechanism