Added server side code as reference