diff --git a/modules/jsonapi_twig/src/TwigExtension.php b/modules/jsonapi_twig/src/TwigExtension.php
index 25878eb..7854cf5 100644
--- a/modules/jsonapi_twig/src/TwigExtension.php
+++ b/modules/jsonapi_twig/src/TwigExtension.php
@@ -27,6 +27,7 @@ class TwigExtension extends \Twig_Extension {
   }
 
   public function fetchFromJsonApi($resource, array $options = []) {
+    // @todo Do we really want to support this shortcut?
     if ($resource instanceof EntityInterface) {
       $resource = "/{$resource->getEntityTypeId()}/{$resource->bundle()}/{$resource->uuid()}";
     }
@@ -35,10 +36,6 @@ class TwigExtension extends \Twig_Extension {
 
     $request = Request::create('/jsonapi/' . ltrim($resource, '/'), 'GET', $options + ['_format' => 'api_json']);
 
-//    if (is_array($options['fields'])) {
-//      $request->query->set('fields', $options['fields']);
-//    }
-
     // @todo Drop this workaround when https://www.drupal.org/node/2613044 is
     // done
     $previous_request = \Drupal::requestStack()->getCurrentRequest();
diff --git a/modules/jsonapi_twig/tests/Kernel/JsonapiTwigIntegrationTest.php b/modules/jsonapi_twig/tests/Kernel/JsonapiTwigIntegrationTest.php
new file mode 100644
index 0000000..1b7d739
--- /dev/null
+++ b/modules/jsonapi_twig/tests/Kernel/JsonapiTwigIntegrationTest.php
@@ -0,0 +1,105 @@
+<?php
+
+namespace Drupal\Tests\jsonapi_twig\Kernel;
+
+use Drupal\KernelTests\KernelTestBase;
+use Drupal\node\Entity\Node;
+use Drupal\node\Entity\NodeType;
+use Drupal\user\Entity\Role;
+
+/**
+ * @group jsonapi_twig
+ */
+class JsonapiTwigIntegrationTest extends KernelTestBase {
+
+  public static $modules = ['system', 'jsonapi', 'jsonapi_twig', 'serialization', 'user', 'node'];
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->installEntitySchema('user');
+    $this->installEntitySchema('node');
+
+    NodeType::create([
+      'type' => 'article'
+    ])->save();
+
+    $this->installConfig('user');
+    Role::load('anonymous')
+      ->grantPermission('access content')
+      ->save();
+  }
+
+  public function providerTestTemplateFunction() {
+    $data = [];
+
+    $template = <<<TWIG
+{% set data = api('node/article/' ~ node.uuid.value) %}
+uuid: {{ data.data.attributes.uuid }}
+title: {{ data.data.attributes.title }}
+TWIG;
+
+    $expected = <<<OUTPUT
+uuid: 0D5DAE5F-DAC6-4216-8D5B-76A01AF12ED3
+title: Test title
+OUTPUT;
+    $data['url'] = [$template, $expected];
+
+    $template = <<<TWIG
+{% set data = api(node, {fields: {'node--article': 'title,uuid'}}) %}
+uuid: {{ data.data.attributes.uuid }}
+title: {{ data.data.attributes.title }}
+TWIG;
+
+    $expected = <<<OUTPUT
+uuid: 0D5DAE5F-DAC6-4216-8D5B-76A01AF12ED3
+title: Test title
+OUTPUT;
+    $data['node-object'] = [$template, $expected];
+
+    $template = <<<TWIG
+{% set data = api('node/article/' ~ node.uuid.value, {fields: {'node--article': 'title,uuid'}}) %}
+uuid: {{ data.data.attributes.uuid }}
+title: {{ data.data.attributes.title }}
+TWIG;
+
+    $expected = <<<OUTPUT
+uuid: 0D5DAE5F-DAC6-4216-8D5B-76A01AF12ED3
+title: Test title
+OUTPUT;
+    $data['url-sparse'] = [$template, $expected];
+
+    return $data;
+  }
+
+  /**
+   * @dataProvider providerTestTemplateFunction
+   */
+  public function testTemplateFunction($template, $expected) {
+    /** @var \Drupal\Core\Render\RendererInterface $renderer */
+    $renderer = \Drupal::service('renderer');
+
+    $node = Node::create([
+      'type' => 'article',
+      'title' => 'Test title',
+      'uuid' => '0D5DAE5F-DAC6-4216-8D5B-76A01AF12ED3',
+      'status' => NODE_PUBLISHED,
+    ]);
+    $node->save();
+
+    $build = [
+      '#type' => 'inline_template',
+      '#template' => $template,
+      '#context' => [
+        'node' => $node,
+      ],
+    ];
+
+
+    $this->assertEquals($expected, (string) $renderer->renderPlain($build));
+  }
+
+}
