front end gets data from api