Update all views to enforce valid=True and key_type checks on APIKeys