Made the API key optional. Fixes #4167