added server, fixed bugs