Minor fixes to server. Add a simple cli client.