moved server-side code in server folder