cleaned up server side file reading and implemented client side file reading