Convert html forms data to json format