updated getFormattedData to provide a more structured and detailed object