diff --git a/src/Plugin/views/display/RestExportNested.php b/src/Plugin/views/display/RestExportNested.php
index 3dcb0d2..17506fd 100644
--- a/src/Plugin/views/display/RestExportNested.php
+++ b/src/Plugin/views/display/RestExportNested.php
@@ -31,28 +31,22 @@ class RestExportNested extends display\RestExport {
     $build['#markup'] = $this->renderer->executeInRenderContext(new RenderContext(), function() {
       return $this->view->style_plugin->render();
     });
+    $class = $this->renderer->executeInRenderContext(new RenderContext(), function () {
+      return get_class($this->view->style_plugin);
+    });
 
     // Decode results.
     $results = \GuzzleHttp\json_decode($build['#markup']);
+    switch ($class) {
+      case 'Drupal\pager_serializer\Plugin\views\style\PagerSerializer':
+        $rows = \Drupal::config('pager_serializer.settings')->get('rows_label');
+        $results->$rows = $this->flatten($results->$rows);
+        break;
 
-    // Loop through results and fields.
-    foreach ($results as $key => $result) {
-      foreach ($result as $property => $value) {
-        // Check if the field can be decoded using PHP's json_decode().
-        if (is_string($value)) {
-          if (json_decode($value) !== NULL) {
-            // If so, use Guzzle to decode the JSON and add it to the results.
-            $results[$key]->$property = \GuzzleHttp\json_decode($value);
-          }
-          elseif (json_decode(Html::decodeEntities($value)) !== NULL){
-            $results[$key]->$property = \GuzzleHttp\json_decode(Html::decodeEntities($value));
-          }
-        }
-        // Special null handling.
-        if (is_string($value) && $value === 'null') {
-          $results[$key]->$property = NULL;
-        }
-      }
+      case 'Drupal\rest\Plugin\views\style\Serializer':
+      default:
+        $results = $this->flatten($results);
+        break;
     }
 
     // Convert back to JSON.
@@ -87,4 +81,35 @@ class RestExportNested extends display\RestExport {
     return $build;
   }
 
+  /**
+   * Flattens nested view.
+   *
+   * @param array $data
+   *   Nested view data.
+   *
+   * @return array
+   *   Flattened view data.
+   */
+  protected function flatten(array $data) {
+    foreach ($data as $key => $result) {
+      foreach ($result as $property => $value) {
+        // Check if the field can be decoded using PHP's json_decode().
+        if (is_string($value)) {
+          if (json_decode($value) !== $value) {
+            // If so, use Guzzle to decode the JSON and add it to the data.
+            $data[$key]->$property = \GuzzleHttp\json_decode($value);
+          }
+          elseif (json_decode(Html::decodeEntities($value)) !== NULL) {
+            $data[$key]->$property = \GuzzleHttp\json_decode(Html::decodeEntities($value));
+          }
+        }
+        // Special null handling.
+        if (is_string($value) && $value === 'null') {
+          $data[$key]->$property = NULL;
+        }
+      }
+    }
+    return $data;
+  }
+
 }
