Return appropriate HTTP status codes