Merged getRecords and getRecordsWithFiles into one function to keep things compact.