private function handleValidation(ServerRequestInterface $request, ResponseInterface $response, NestedValidationException $exception)
{
$body = json_encode(['message' => 'There was a problem when validating', 'errors' => $exception->getMessages()]);
return $response->withStatus(400)->withHeader('Content-type', 'application/json')->write($body);
}