### What problem does this PR solve? Split message apis to gateway and service ### Type of change - [x] Refactoring
### What problem does this PR solve? Decouple the memory API into a gateway layer (for routing/param parse) and a service layer (for business logic). ### Type of change - [x] Refactoring