public function prepareListQuery()
    {
        /* @var $modelClass \yii\db\BaseActiveRecord */
        $modelClass = $this->modelClass;

        $find = $modelClass::ngRestFind();

        // check if a pool id is requested:
        $this->appendPoolWhereCondition($find);

        // add tags condition
        $tagIds = Yii::$app->request->get('tags');
        if ($tagIds) {
            $subQuery = clone $find;
            $inQuery = $subQuery->joinWith(['tags tags'])->andWhere(['tags.id' => array_unique(explode(",", $tagIds))])->select(['pk_id']);
            $find->andWhere(['in', $modelClass::primaryKey(), $inQuery]);
        }

        return $find->with($this->getWithRelation('list'));
    }