clean up some aspects in the error handling of requests