corrected json structure for templates, fixed some failing tests