Implementing getRecords method