I\'m trying to show a loading gif while certain api calls are executed (depending on the requested amount of data this can take between 1 and 5 seconds). However when I try