How to Design REST API Endpoints for AI Applications