working on the json structures and creating the call