Improve response codes and error messages.