Added server code for reference