modifies JSON before returnin, update template accordingle