Implemented 400s and 501.

This is the initial release which has basic support for error codes.