getBody()->write(\Safe\json_encode($data)); return $response ->withStatus($status) ->withHeader('Content-Type', 'application/json'); } }