first pass at the server (untested)