Get real status code instead of hardcoded 500