moved code to server directory