Add API + tests for Swarm

This comment is not accurate. The standard error is redirected to standard output (probably worth to use stderr?) and the stdout is re-directed to a PIPE.