access api data with useeffect hook