implement output formats both for CLI and WS