added logic to edit template for request type /template/[slug]