Check for http status, throw error