updates to the code to get api endpoints