templateData fix and api usage