Added metadata to templates for resource matching and adjusted RESTful API

* Added integration test