moved server code to server folder