added exception raising for http errors