Reworked template attributes and added json serialisers for templates