add api data fetch code in background thread