move server to a separate module, code used by client and server resides in flow