How to Design Secure API Endpoints