add DI to client and server code