Include data and status code when throwing an error in HttpApi

This is the same as #59. I by mistake made a pull request with master as a base branch (sorry).