Fix the tests and a problem where NotFoundErrors weren't converted to 404 responses