Implemented retrieval of data and aggregation for the GUI