added exceptions for http errors
added code folds