support nested VMs and update examples to use new API