public function create($client = null)
    {
        if ($this->exists()) {
            $this->logger->debug(
                'A REST API named "' . $this->name . '" already exists'
            );
            return $this;
        }
        $this->client = $client ?: $this->client;
        $params = array();
        $headers = array('Content-type' => 'application/json');
        $body = '
            {
                "rest-api": {
                    "name": "' . $this->name . '",
                    "database": "' . $this->db . '",
                    "modules-database": "' . $this->db . '-modules",
                    "port": "' . $this->port . '",
                    "forests-per-host": 1,
                    "error-format": "json"
                }
            }
        ';
        $request = new RESTRequest('POST', 'rest-apis', $params, $body, $headers);
        $this->logger->debug(
            "Setting up REST API: " . $this->name .
            ' (' . $this->db . ') port ' . $this->port
        );
        $this->client->send($request); // Set up REST API
        return $this;
    }