Added error handling for http util methods