fix the hard coded API endpoint