server side code to CS