implements server. closes #15