protected function respondWithMessage($success = true, $message = '', $code = 0)
    {
        if (!$message) {
            if ($success) {
                $message = rawurlencode(_t(
                    'CMSMain.ACTION_COMPLETE',
                    'Done'
                ));
            } else {
                $message = rawurlencode(_t(
                    'CMSMain.ACTION_FAILED',
                    'Could not complete action'
                ));
            }
        }

        if (!$code) {
            $code = $success ? 200 : 400;
        }

        $this->owner->Response->setStatusCode($code);
        $this->owner->Response->addHeader('X-Status', $message);

        return $this->owner->getResponseNegotiator()->respond($this->owner->Request, [
            'SiteTree' => function () {
            }
        ]);
    }