Added exception handling on http requests