retrieve api result and store in db