API key validation fix