You can use 'pvesh' for testing the api:
# pvesh help /nodes/localhost/openvz
help [path] [--verbose]
cd [path]
ls [path]
create /nodes/{node}/openvz -ostemplate <string> -vmid <integer> [OPTIONS]
delete /nodes/{node}/openvz/{vmid}
To create container 555 use:
# pvesh create /nodes/localhost/openvz -ostemplate local:vztmpl/debian-6.0-standard_6.0-4_i386.tar.gz -vmid 555
To list all templates on local storage:
# pvesm list local -content vztmpl
local:vztmpl/centos-5-standard_5.6-1_i386.tar.gz tgz 181390534
local:vztmpl/debian-6.0-joomla_1.6-3_i386.tar.gz tgz 182693140
local:vztmpl/debian-6.0-standard_6.0-4_i386.tar.gz tgz 143694277
And finally delete the container:
# pvesh delete /nodes/localhost/openvz/555