public function delete($client = null)
    {
        $this->client = $client ?: $this->client;
        // Delete content and modules as well
        $params = array('include' => array('content', 'modules'));
        $body = null;
        $headers = array();
        $request = new RESTRequest(
            'DELETE', 'rest-apis/' . $this->name, $params, $body, $headers
        );

        $this->client->send($request);

        // Wait for server reboot
        $requestWait = new RESTRequest('GET', 'rest-apis');
        $this->waitUntilSuccess($requestWait, 3, 10);
    }