Refactor server to expose a standard interface