Fix a traceback when starting the api

Closes-bug: #1340737