updating code to reflect new api endpoint