adapt server to integrate with client code