Added server code
Some changes