added some (not very good) server code