Fix up the handling of the API key in the CLI