Added filter and filter type for database queries