public function fetchBatches(BatchFilter $filter = null)
    {
        return new Api\Pages(
            function ($page) use ($filter) {
                $params = ["page=$page"];

                if (!is_null($filter)) {
                    if (null != $filter->getPageSize()) {
                        array_push(
                            $params, 'page_size=' . $filter->getPageSize()
                        );
                    }

                    if (null != $filter->getSenders()) {
                        $val = urlencode(join(',', $filter->getSenders()));
                        array_push($params, 'from=' . $val);
                    }

                    if (null != $filter->getTags()) {
                        $val = urlencode(join(',', $filter->getTags()));
                        array_push($params, 'tags=' . $val);
                    }

                    if (null != $filter->getStartDate()) {
                        $val = $filter->getStartDate()->format('Y-m-d');
                        array_push($params, 'start_date=' . $val);
                    }

                    if (null != $filter->getEndDate()) {
                        $val = $filter->getEndDate()->format('Y-m-d');
                        array_push($params, 'end_date=' . $val);
                    }
                }

                $q = join('&', $params);
                $result = $this->_get($this->_url('/batches?' . $q));
                return Deserialize::batchesPage($result);
            }
        );
    }