Modified json return as json/dict format in getTemplate function