Convert data fetch in angular service