document api/template and fix up a couple tests