Improve API endpoint retrieval