Creating a secure API server