updated with json reading in server side