Further unit tests, and better http response codes.