Http status codes

Well, here it is.

This includes all the fixes talked about in #1571