Getting the response 3 times

Eeverything was going okay, since all of the sudden I started getting the response of the request 3 times.

for example this is my response to create a new jwt

{
"status": "ok",
"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODE1MTUwMDIsImp0aSI6IjUzcEZUYnRWNEtzTXJIUVRwb1l1ck8ifQ.MsXm_BBEmgBWz5UCTzYGs61nVYw4XJbcGc1NJLziRP8",
"expires": 1581515602
}{
"status": "ok",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODE1MTUwMDIsImp0aSI6IjUzcEZUYnRWNEtzTXJIUVRwb1l1ck8ifQ.MsXm_BBEmgBWz5UCTzYGs61nVYw4XJbcGc1NJLziRP8",
"expires": 1581515602
}{
"status": "ok",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1ODE1MTUwMDIsImp0aSI6IjVKVW52dDFEMVZ2cXVaUHR2S2JaRGYifQ.LrntDIb6AWTbdfbGEeZgMoS17qoeCWRBS_yc0MbsfZE",
"expires": 1581515602

}

and my route looks like this.

$app->get('/first_token', function ($request, $response) use ($secret) {
$now = new DateTime();
$future = new DateTime("+10 minutes");
$server = $request->getServerParams();
$jti = (new Base62)->encode(random_bytes(16));
$payload = [
    "iat" => $now->getTimeStamp(),
    "jti" => $jti,
];
$token = JWT::encode($payload, $secret, "HS256");
$data["status"] = "ok";
$data["token"] = $token;
$data["expires"] = $future->getTimeStamp();
return $response->withStatus(201)
    ->withHeader("Content-Type", "application/json")
    ->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));

});

Any idea why i am getting the response 3 times?