Added detection of empty API keys