adding loading spinner while loading data from the api