split backend into localhost and relay servers