private function exec($command, $params = []) {
        if (in_array($command, $this->available_commands)) {
            // convert json to array then get the last messages info
            $output = json_decode($this->curl_get_contents($this->api . '/' . $command, $params), true);

            return $this->convertToObject($output);
        } else {
            echo 'command not found';
        }
    }