use toJSON2 so that JS literals can be passed to the payload
add another template for examples.