moved server-side code into own directory