async function getWords(req: Request, res: Response) { const words = await req.watsonSTT.listWords(); if (words[0]) { req.log.error(`failed to get words: ${JSON.stringify(words[0], null, 2)}`); return res.status(500).json({ error: words[0].error || 'failed to get words' }); } else { return res.status(200).json({ words: words[1].words }); } }