Fix data collection for return JSON