Slim can use withJson() that can return JSON responses with desired route and method
$app = new \Slim\App();
$app->get('/api/person', function ($request, $response, $args) {
$payload=[];
array_push($payload, array("name"=>"Bob" ,"birth-year"=>1993));
ar...