Fix warning in new rest api key generation

Fix a warning when generating new API keys for the REST API #4055