Changes in getAll function to add filter option