Fix data fetching from server

In case server is unavailable the app is crashing because nothing is fetched. This is a fix for it