generate json outside request