More API fleshout for doc
Add comments and support for logic to tmpl