javascript check if json object is not empty