Restful CRUD API with Node.js and Express
I know you are generating data for the sake of completion but it does complicate things on what aspect of the code you'd like to focus on. But here are a couple thoughts.

With Express, I often like to treat the routes as controllers in an MVC pattern. So any fetching of data and mutating data, I would create at least a model per resource to encapsulate that part of the code. So the interface may look something like the below:

app.get('/names', async (req, res) =&gt; {
  // assuming we are getting data from an async call to a db
  const names = await Name.all(); 
  res.json(names)
})

app.post('/names', async (req, res) =&gt; {
  const newName = await Name.create(req.body);

  res
    .status(201) 
    .json({ id: newName.id }) 
})

app.put('/names', async (req, res) =&gt; {
  const { id } = req.body
  const name = await Name.findAndUpdate(id, req.body);
  res
    .status(200)
    .json(name)
})

app.delete('/names', async (req, res) =&gt; {
  const { id } = req.body 
  const deleted = await Name.deleteById(id)
  res
    .status(200)
    .json({ status: 'success'})
})


Notice that we can implement "Name" class with whatever database(or file or no database) we want. As long as we keep the interface the same, we can swap different "Name" class implementations without having to change our Express routes. 

One last point, since there is no "view" suggested here but we can have it if we want. For example, if for some reason, our model doesn't return us exactly what we need, maybe the key is slightly off from our API specifications, we can introduce a view layer that maps whatever the model returns us. This way we can continue to keep our Express routes very thin and handling specific to request/response related responsibilities.