implemented createServer method and added tests