Transform JSON with templates