convert response to json

code refinements
update ids after sync