JSON parse issue

Waiting until all the datas are gathered.

Had an unexpected end error, another option is to use res.readyState == 4.