implemented data retrieval to front end