Add a few more tests, and fix error response format.