WIP added master and slave functions to allow multiple servers.