diff --git a/src/Controller/SchemaApiController.php b/src/Controller/SchemaApiController.php
index <HASH>..<HASH> 100644
--- a/src/Controller/SchemaApiController.php
+++ b/src/Controller/SchemaApiController.php
@@ -306,13 +306,11 @@ class SchemaApiController extends SchemaApiAbstract implements DocumentedInterfa
             $headers    = $response->getHeaders();
 
             if (!empty($statusCode)) {
-                $this->setResponseCode($statusCode);
+                $this->response->setStatus($statusCode);
             }
 
             if (!empty($headers)) {
-                foreach ($headers as $name => $value) {
-                    $this->setHeader($name, $value);
-                }
+                $this->response->setHeaders($headers);
             }
 
             return $response->getBody();
set status code and headers direct on response