working with json doing the same as text but able to switch between the 2