figured out how to get the json.
working out functions.