finish server side coding stage1