a REST API endpoint that optimizes message routing