updated server code
updated index location and added public structure