Implement and test HTTP API for template updating

Implements PUT /template/:template_id