Added server code. Blocking needs to be sorted.