public function bucket($key = null) {
        if (!$this->id) {
            throw new Exception("The server has no ID, can\'t get buckets");
        }

        $bucket = new Bucket($this->patrol);

        $bucket->defaults([
            'server_id' => $this->id
        ]);

        if (is_null($key)) {
            return $bucket;
        }

        try {
            return $bucket->find($key);
        } catch (Exception $ex) {
            if ($ex->getMessage() === "Bucket does not exist") {
                $bucket->key = $key;
                return $bucket;
            }
        }

        return null;
    }