Fixed failing connection spec
Added better error handling & http status code support