cleaning up the server side error handling