Fixing the API endpoint issue