To decode the data and extract the body from the json reponse we can use the following function:
an example of the function above being used in practice: