Changed the way we handle errors a little bit so that we can distinguish between them.

More specifically, added an Error-Type header which is interpreted by
the client side.