Add server implementation.
Refactor.