server: implement most of it...