Add API + tests for Swarm

Uhm... why are you waiting for the process here? it looks to me that you should wait for the process before actually doing the process of their output right?