use the returned http status code

also raise an error if headless is broken