A Pretty Flexible API for Generic Peer-to-peer Programming