In a microservices architecture, what is the primary purpose of the API Gateway as a security pattern?