Improved error handling, removed BOM check, centralised the http request