get data from external api and save to db