remove square brackets from json javascript