diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1adb5b64a4cc6d95f399a1fec00d4247be64fa2b..ab36db73d812744c2b0e4b8ff289fcc800d3dcd3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ This is a changelog for Piwik platform developers. All changes for our HTTP API'
 * The [settings](http://developer.piwik.org/guides/piwik-configuration) API will receive the actual entered value and will no longer convert characters like `&` to `&`. If you still want this behavior - for instance to prevent XSS - you can define a filter by setting the `transform` property like this:
   `$setting->transform = function ($value) { return Common::sanitizeInputValue($value); }`
 * Config setting `disable_merged_assets` moved from `Debug` section to `Development`. The updater will automatically change the section for you.
+* `API.getRowEvolution` will throw an exception if a report is requested that does not have a dimension, for instance `VisitsSummary.get`. This is a fix as an invalid format was returned before see [#5951](https://github.com/piwik/piwik/issues/5951)
 
 ### Deprecations
 The following events are considered as deprecated and the new structure should be used in the future. We have not scheduled when those events will be removed but probably in Piwik 3.0 which is not scheduled yet and won't be soon. New features will be added only to the new classes.
diff --git a/plugins/API/RowEvolution.php b/plugins/API/RowEvolution.php
index 84bc431c4765d3b90e64d964175656462c92932b..7a5290c44fdd824740adedbd4147ddadb1254018 100644
--- a/plugins/API/RowEvolution.php
+++ b/plugins/API/RowEvolution.php
@@ -331,6 +331,10 @@ class RowEvolution
             $metrics = $metrics + $reportMetadata['processedMetrics'];
         }
 
+        if (empty($reportMetadata['dimension'])) {
+            throw new Exception(sprintf('Reports like %s.%s which do not have a dimension are not supported by row evolution', $apiModule, $apiAction));
+        }
+
         $dimension = $reportMetadata['dimension'];
 
         return compact('metrics', 'dimension');
diff --git a/plugins/API/tests/RowEvolutionTest.php b/plugins/API/tests/RowEvolutionTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..b341efd91acc5f91aee10ab6509ca1efe12bd01a
--- /dev/null
+++ b/plugins/API/tests/RowEvolutionTest.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+namespace Piwik\Plugins\API\tests;
+use Piwik\Plugins\API\RowEvolution;
+use Piwik\Tests\Fixture;
+
+/**
+ * @group API
+ * @group RowEvolutionTest
+ * @group Database
+ */
+class RowEvolutionTest extends \DatabaseTestCase
+{
+
+    public function setUp()
+    {
+        parent::setUp();
+        Fixture::createWebsite('2014-01-01 00:00:00');
+    }
+
+    /**
+     * @expectedException \Exception
+     * @expectedExceptionMessage Reports like VisitsSummary.get which do not have a dimension are not supported by row evolution
+     */
+    public function test_getRowEvolution_shouldTriggerAnException_IfReportHasNoDimension()
+    {
+        $rowEvolution = new RowEvolution();
+        $rowEvolution->getRowEvolution(1, 'day', 'last7', 'VisitsSummary', 'get');
+    }
+
+    public function test_getRowEvolution_shouldNotTriggerAnException_IfReportHasADimension()
+    {
+        $rowEvolution = new RowEvolution();
+        $table = $rowEvolution->getRowEvolution(1, 'day', 'last7', 'Actions', 'getPageUrls');
+        $this->assertNotEmpty($table);
+    }
+
+}