server stuff

implemented missing features, added some exception handling, various cleanups