added support to accept empty API key