Better method of retrieving api data