Wrapped both the client and server in functions