Implement and test HTTP API for template creation

Implements POST /template