Fix HTTP status code usage; use constants for them