Check for `'name_vm'` before accessing: `if 'name_vm' in req.json: ...`