finished the fetch function, api now working