fetching data from api instead of direct access