changed the json format, did some tweeks to js