diff --git a/src/SearchEndpoint/AggregationsEndpoint.php b/src/SearchEndpoint/AggregationsEndpoint.php
index a92bd5559772c2a86b5de047a3703cd993849379..e9f9ae7e7d8c0ab4ea75cc41b426c0c94d0b61e7 100644
--- a/src/SearchEndpoint/AggregationsEndpoint.php
+++ b/src/SearchEndpoint/AggregationsEndpoint.php
@@ -26,14 +26,14 @@ class AggregationsEndpoint implements SearchEndpointInterface
     /**
      * @var NamedBuilderBag
      */
-    private $builderContainer;
+    private $bag;
 
     /**
      * Initialized aggregations bag.
      */
     public function __construct()
     {
-        $this->builderContainer = new NamedBuilderBag();
+        $this->bag = new NamedBuilderBag();
     }
 
     /**
@@ -41,8 +41,8 @@ class AggregationsEndpoint implements SearchEndpointInterface
      */
     public function normalize(NormalizerInterface $normalizer, $format = null, array $context = [])
     {
-        if (count($this->builderContainer->all()) > 0) {
-            return $this->builderContainer->toArray();
+        if (count($this->bag->all()) > 0) {
+            return $this->bag->toArray();
         }
 
         return null;
@@ -57,7 +57,7 @@ class AggregationsEndpoint implements SearchEndpointInterface
             throw new \InvalidArgumentException('Builder must be named builder');
         }
 
-        $this->builderContainer->add($builder);
+        $this->bag->add($builder);
 
         return $builder->getName();
     }
@@ -67,7 +67,7 @@ class AggregationsEndpoint implements SearchEndpointInterface
      */
     public function getBuilders()
     {
-        return $this->builderContainer->all();
+        return $this->bag->all();
     }
 
     /**
@@ -75,7 +75,11 @@ class AggregationsEndpoint implements SearchEndpointInterface
      */
     public function getBuilder($key)
     {
-        return $this->builderContainer->get($key);
+        if (!$this->bag->has($key)) {
+            return null;
+        }
+
+        return $this->bag->get($key);
     }
 
     /**
@@ -83,7 +87,7 @@ class AggregationsEndpoint implements SearchEndpointInterface
      */
     public function removeBuilder($key)
     {
-        $this->builderContainer->remove($key);
+        $this->bag->remove($key);
 
         return $this;
     }
diff --git a/tests/SearchEndpoint/AggregationsEndpointTest.php b/tests/SearchEndpoint/AggregationsEndpointTest.php
index 078d56fa64940ba1f325a3abb1b6ff9ec0d205df..616d872b672911dfb56bfa0afa18e45cd4cbc002 100644
--- a/tests/SearchEndpoint/AggregationsEndpointTest.php
+++ b/tests/SearchEndpoint/AggregationsEndpointTest.php
@@ -11,7 +11,11 @@
 
 namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint;
 
+use ONGR\ElasticsearchDSL\BuilderInterface;
+use ONGR\ElasticsearchDSL\NamedBuilderInterface;
 use ONGR\ElasticsearchDSL\SearchEndpoint\AggregationsEndpoint;
+use PHPUnit_Framework_MockObject_MockObject as MockObject;
+use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
 
 /**
  * Class AggregationsEndpointTest.
@@ -28,4 +32,94 @@ class AggregationsEndpointTest extends \PHPUnit_Framework_TestCase
             new AggregationsEndpoint()
         );
     }
+
+    /**
+     * Tests AddBuilder.
+     */
+    public function testAddBuilder()
+    {
+        $instance = new AggregationsEndpoint();
+
+        /** @var NamedBuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\NamedBuilderInterface');
+        $builderInterface1->expects($this->any())->method('getName')->willReturn('namedBuilder');
+        $key = $instance->addBuilder($builderInterface1);
+        $this->assertSame('namedBuilder', $key);
+        $this->assertSame($builderInterface1, $instance->getBuilder($key));
+
+        /** @var BuilderInterface|MockObject $builderInterface2 */
+        $builderInterface2 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+
+        $this->setExpectedException('InvalidArgumentException', 'Builder must be named builder');
+        $instance->addBuilder($builderInterface2);
+    }
+
+    /**
+     * Tests removing builders.
+     */
+    public function testRemoveBuilder()
+    {
+        $instance = new AggregationsEndpoint();
+        /** @var NamedBuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\NamedBuilderInterface');
+        $builderInterface1->expects($this->any())->method('getName')->willReturn('namedBuilder');
+        $key = $instance->addBuilder($builderInterface1);
+
+        $this->assertNotNull($instance->getBuilder($key));
+        $this->assertSame($instance, $instance->removeBuilder($key));
+        $this->assertNull($instance->getBuilder($key));
+    }
+
+    /**
+     * Tests getting all builders.
+     */
+    public function testGetBuilders()
+    {
+        $instance = new AggregationsEndpoint();
+        $this->assertSame([], $instance->getBuilders());
+
+        /** @var NamedBuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\NamedBuilderInterface');
+        $builderInterface1->expects($this->any())->method('getName')->willReturn('namedBuilder');
+
+        $instance->addBuilder($builderInterface1);
+        $this->assertSame(['namedBuilder' => $builderInterface1], $instance->getBuilders());
+
+        /** @var NamedBuilderInterface|MockObject $builderInterface2 */
+        $builderInterface2 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\NamedBuilderInterface');
+        $builderInterface2->expects($this->any())->method('getName')->willReturn('namedBuilder2');
+
+        $instance->addBuilder($builderInterface2);
+        $this->assertSame(
+            [
+                'namedBuilder' => $builderInterface1,
+                'namedBuilder2' => $builderInterface2,
+            ],
+            $instance->getBuilders()
+        );
+    }
+
+    /**
+     * Tests normalization builder.
+     */
+    public function testNormalization()
+    {
+        $instance = new AggregationsEndpoint();
+        /** @var NormalizerInterface|MockObject $normalizerInterface */
+        $normalizerInterface = $this->getMockForAbstractClass(
+            'Symfony\Component\Serializer\Normalizer\NormalizerInterface'
+        );
+
+        $this->assertNull($instance->normalize($normalizerInterface));
+
+        /** @var NamedBuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\NamedBuilderInterface');
+        $builderInterface1->expects($this->any())->method('getName')->willReturn('namedBuilder');
+        $builderInterface1->expects($this->exactly(1))->method('toArray')->willReturn(['array' => 'data']);
+        $builderInterface1->expects($this->exactly(0))->method('getType')->willReturn('test');
+
+        $instance->addBuilder($builderInterface1);
+
+        $this->assertSame(['array' => 'data'], $instance->normalize($normalizerInterface));
+    }
 }
diff --git a/tests/SearchEndpoint/FilterEndpointTest.php b/tests/SearchEndpoint/FilterEndpointTest.php
index 33faf0dff53ced7f4c8db00f7d1f50239361b031..3de6d22c04195b3d47d2fade62b4104338f062e1 100644
--- a/tests/SearchEndpoint/FilterEndpointTest.php
+++ b/tests/SearchEndpoint/FilterEndpointTest.php
@@ -11,7 +11,11 @@
 
 namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint;
 
+use ONGR\ElasticsearchDSL\BuilderInterface;
+use ONGR\ElasticsearchDSL\Query\FilteredQuery;
 use ONGR\ElasticsearchDSL\SearchEndpoint\FilterEndpoint;
+use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+use PHPUnit_Framework_MockObject_MockObject as MockObject;
 
 /**
  * Class FilterEndpointTest.
@@ -28,4 +32,54 @@ class FilterEndpointTest extends \PHPUnit_Framework_TestCase
             new FilterEndpoint()
         );
     }
+
+    /**
+     * Tests if correct order is returned.
+     */
+    public function testGetOrder()
+    {
+        $instance = new FilterEndpoint();
+        $this->assertEquals(1, $instance->getOrder());
+    }
+
+    /**
+     * Test normalization.
+     */
+    public function testNormalization()
+    {
+        $instance = new FilterEndpoint();
+        /** @var NormalizerInterface|MockObject $normalizerInterface */
+        $normalizerInterface = $this->getMockForAbstractClass(
+            'Symfony\Component\Serializer\Normalizer\NormalizerInterface'
+        );
+        $this->assertNull($instance->normalize($normalizerInterface));
+        $this->assertFalse($instance->hasReference('filtered_query'));
+
+        /** @var BuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+        $builderInterface1->expects($this->exactly(1))->method('toArray')->willReturn(['array' => 'data']);
+        $builderInterface1->expects($this->exactly(1))->method('getType')->willReturn('test');
+        $instance->addBuilder($builderInterface1);
+
+        $this->assertNull($instance->normalize($normalizerInterface));
+        $this->assertTrue($instance->hasReference('filtered_query'));
+        /** @var FilteredQuery $reference */
+        $reference = $instance->getReference('filtered_query');
+        $this->assertInstanceOf('ONGR\ElasticsearchDSL\Query\FilteredQuery', $reference);
+        $this->assertSame($builderInterface1, $reference->getFilter());
+
+        $instance = new FilterEndpoint();
+        /** @var BuilderInterface|MockObject $builderInterface2 */
+        $builderInterface2 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+        $builderInterface2->expects($this->exactly(1))->method('toArray')->willReturn(['array2' => 'data2']);
+        $builderInterface2->expects($this->exactly(1))->method('getType')->willReturn('test2');
+        $instance->addBuilder($builderInterface1);
+        $instance->addBuilder($builderInterface2);
+
+        $this->assertNull($instance->normalize($normalizerInterface));
+        $this->assertTrue($instance->hasReference('filtered_query'));
+        $reference = $instance->getReference('filtered_query');
+        $this->assertInstanceOf('ONGR\ElasticsearchDSL\Query\FilteredQuery', $reference);
+        $this->assertInstanceOf('ONGR\ElasticsearchDSL\Filter\BoolFilter', $reference->getFilter());
+    }
 }
diff --git a/tests/SearchEndpoint/HighlightEndpointTest.php b/tests/SearchEndpoint/HighlightEndpointTest.php
index e1b59346514bc9a342c1ce995304e9f85d8d2b10..90967c66de6da76a721fde5066f6f909dec2cb2b 100644
--- a/tests/SearchEndpoint/HighlightEndpointTest.php
+++ b/tests/SearchEndpoint/HighlightEndpointTest.php
@@ -11,7 +11,10 @@
 
 namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint;
 
+use ONGR\ElasticsearchDSL\BuilderInterface;
 use ONGR\ElasticsearchDSL\SearchEndpoint\HighlightEndpoint;
+use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+use PHPUnit_Framework_MockObject_MockObject as MockObject;
 
 /**
  * Class HighlightEndpointTest.
@@ -25,4 +28,43 @@ class HighlightEndpointTest extends \PHPUnit_Framework_TestCase
     {
         $this->assertInstanceOf('ONGR\ElasticsearchDSL\SearchEndpoint\HighlightEndpoint', new HighlightEndpoint());
     }
+
+    /**
+     * Tests adding builder.
+     */
+    public function testAddBuilder()
+    {
+        $instance = new HighlightEndpoint();
+
+        /** @var BuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+        $key = $instance->addBuilder($builderInterface1);
+        $this->assertNotNull($key);
+        $this->assertSame($builderInterface1, $instance->getBuilder($key));
+
+        $this->setExpectedException('OverflowException', 'Only one highlight is expected');
+        $instance->addBuilder($builderInterface1);
+    }
+
+    /**
+     * Tests adding builder.
+     */
+    public function testNormalization()
+    {
+        $instance = new HighlightEndpoint();
+        /** @var NormalizerInterface|MockObject $normalizerInterface */
+        $normalizerInterface = $this->getMockForAbstractClass(
+            'Symfony\Component\Serializer\Normalizer\NormalizerInterface'
+        );
+
+        $this->assertNull($instance->normalize($normalizerInterface));
+
+        /** @var BuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+        $builderInterface1->expects($this->exactly(1))->method('toArray')->willReturn(['array' => 'data']);
+        $builderInterface1->expects($this->exactly(0))->method('getType')->willReturn('test');
+
+        $instance->addBuilder($builderInterface1);
+        $this->assertSame(['array' => 'data'], $instance->normalize($normalizerInterface));
+    }
 }
diff --git a/tests/SearchEndpoint/PostFilterEndpointTest.php b/tests/SearchEndpoint/PostFilterEndpointTest.php
index 08e0593576cb0527d3e9536e1ff9dd184525dc5f..857cdbc8e0b83cd9fcbd5173f04f076282616821 100644
--- a/tests/SearchEndpoint/PostFilterEndpointTest.php
+++ b/tests/SearchEndpoint/PostFilterEndpointTest.php
@@ -11,7 +11,10 @@
 
 namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint;
 
+use ONGR\ElasticsearchDSL\BuilderInterface;
 use ONGR\ElasticsearchDSL\SearchEndpoint\PostFilterEndpoint;
+use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+use PHPUnit_Framework_MockObject_MockObject as MockObject;
 
 /**
  * Class PostFilterEndpointTest.
@@ -25,4 +28,25 @@ class PostFilterEndpointTest extends \PHPUnit_Framework_TestCase
     {
         $this->assertInstanceOf('ONGR\ElasticsearchDSL\SearchEndpoint\PostFilterEndpoint', new PostFilterEndpoint());
     }
+
+    /**
+     * Test normalization.
+     */
+    public function testNormalization()
+    {
+        $instance = new PostFilterEndpoint();
+        /** @var NormalizerInterface|MockObject $normalizerInterface */
+        $normalizerInterface = $this->getMockForAbstractClass(
+            'Symfony\Component\Serializer\Normalizer\NormalizerInterface'
+        );
+        $this->assertNull($instance->normalize($normalizerInterface));
+
+        /** @var BuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+        $builderInterface1->expects($this->exactly(1))->method('toArray')->willReturn(['array' => 'data']);
+        $builderInterface1->expects($this->exactly(1))->method('getType')->willReturn('test');
+
+        $instance->addBuilder($builderInterface1);
+        $this->assertSame(['test' => ['array' => 'data']], $instance->normalize($normalizerInterface));
+    }
 }
diff --git a/tests/SearchEndpoint/QueryEndpointTest.php b/tests/SearchEndpoint/QueryEndpointTest.php
index 4ac1da1d12c285fd2b36fd7fd2dab338f45a6e4d..e22cf4a668b32bd7e4ca231990e80bd4310cb41b 100644
--- a/tests/SearchEndpoint/QueryEndpointTest.php
+++ b/tests/SearchEndpoint/QueryEndpointTest.php
@@ -13,6 +13,7 @@ namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint;
 
 use ONGR\ElasticsearchDSL\BuilderInterface;
 use ONGR\ElasticsearchDSL\Query\BoolQuery;
+use ONGR\ElasticsearchDSL\Query\FilteredQuery;
 use ONGR\ElasticsearchDSL\SearchEndpoint\QueryEndpoint;
 use PHPUnit_Framework_MockObject_MockObject as MockObject;
 use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
@@ -102,4 +103,42 @@ class QueryEndpointTest extends \PHPUnit_Framework_TestCase
             $data
         );
     }
+
+    /**
+     * Tests filtered query reference.
+     */
+    public function testFilteredQuery()
+    {
+        $instance = new QueryEndpoint();
+        /** @var NormalizerInterface|MockObject $normalizerInterface */
+        $normalizerInterface = $this->getMockForAbstractClass(
+            'Symfony\Component\Serializer\Normalizer\NormalizerInterface'
+        );
+        /** @var BuilderInterface|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+        $builderInterface1->expects($this->exactly(1))->method('toArray')->willReturn(['array' => 'data']);
+        $builderInterface1->expects($this->exactly(1))->method('getType')->willReturn('test');
+
+        /** @var BuilderInterface|MockObject $builderInterface2 */
+        $builderInterface2 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+        $builderInterface2->expects($this->exactly(1))->method('toArray')->willReturn(['array2' => 'data2']);
+        $builderInterface2->expects($this->exactly(1))->method('getType')->willReturn('test2');
+
+        $filteredQuery = new FilteredQuery($builderInterface1, $builderInterface2);
+        $instance->addReference('filtered_query', $filteredQuery);
+
+        $this->assertSame(
+            [
+                'filtered' => [
+                    'filter' => [
+                        'test2' => ['array2' => 'data2'],
+                    ],
+                    'query' => [
+                        'test' => ['array' => 'data'],
+                    ],
+                ],
+            ],
+            $instance->normalize($normalizerInterface)
+        );
+    }
 }
diff --git a/tests/SearchEndpoint/SortEndpointTest.php b/tests/SearchEndpoint/SortEndpointTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..7ae8f11fae92caf392e1ae6dce38c5c35eb44e41
--- /dev/null
+++ b/tests/SearchEndpoint/SortEndpointTest.php
@@ -0,0 +1,78 @@
+<?php
+
+/*
+ * This file is part of the ONGR package.
+ *
+ * (c) NFQ Technologies UAB <info@nfq.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace ONGR\ElasticsearchDSL\Tests\Unit\SearchEndpoint;
+
+use ONGR\ElasticsearchDSL\BuilderInterface;
+use ONGR\ElasticsearchDSL\SearchEndpoint\SortEndpoint;
+use ONGR\ElasticsearchDSL\Sort\AbstractSort;
+use PHPUnit_Framework_MockObject_MockObject as MockObject;
+use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+
+/**
+ * Class SortEndpointTest.
+ */
+class SortEndpointTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * Tests constructor.
+     */
+    public function testItCanBeInstantiated()
+    {
+        $this->assertInstanceOf('ONGR\ElasticsearchDSL\SearchEndpoint\SortEndpoint', new SortEndpoint());
+    }
+
+    /**
+     * Tests AddBuilder.
+     */
+    public function testAddBuilder()
+    {
+        $instance = new SortEndpoint();
+
+        /** @var AbstractSort|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockBuilder('ONGR\ElasticsearchDSL\Sort\AbstractSort')
+            ->disableOriginalConstructor()
+            ->getMockForAbstractClass();
+
+        $key = $instance->addBuilder($builderInterface1);
+        $this->assertNotNull($key);
+        $this->assertSame($builderInterface1, $instance->getBuilder($key));
+
+        /** @var BuilderInterface|MockObject $builderInterface2 */
+        $builderInterface2 = $this->getMockForAbstractClass('ONGR\ElasticsearchDSL\BuilderInterface');
+
+        $this->setExpectedException('InvalidArgumentException', 'Sort must must a subtype of AbstractSort');
+        $instance->addBuilder($builderInterface2);
+    }
+
+    /**
+     * Tests if endpoint return correct normalized data.
+     */
+    public function testEndpoint()
+    {
+        $instance = new SortEndpoint();
+        /** @var NormalizerInterface|MockObject $normalizerInterface */
+        $normalizerInterface = $this->getMockForAbstractClass(
+            'Symfony\Component\Serializer\Normalizer\NormalizerInterface'
+        );
+        $this->assertNull($instance->normalize($normalizerInterface));
+
+        /** @var AbstractSort|MockObject $builderInterface1 */
+        $builderInterface1 = $this->getMockBuilder('ONGR\ElasticsearchDSL\Sort\AbstractSort')
+            ->disableOriginalConstructor()
+            ->getMockForAbstractClass();
+        $builderInterface1->expects($this->exactly(0))->method('toArray')->willReturn(['array' => 'data']);
+        $builderInterface1->expects($this->exactly(2))->method('getType')->willReturn('test');
+        $instance->addBuilder($builderInterface1);
+
+        $this->assertSame(['test' => ['order' => 'asc']], $instance->normalize($normalizerInterface));
+    }
+}