getParsedBody(); $output = [ 'pie_id' => $pie_id, 'input' => $body, 'edited' => false ]; try { $pie = $pieService->getById($pie_id); $pieService->edit($pie, (array) $body); $output['edited'] = true; } catch (EmptyResult) {} return $this->withJson($response, $output); } }