recreating the data array each time the API gets called