This is basic Web Service Implementation looks like REST call (but not a REST call). You can directly use this as ready to go framework kind of thing you dont need to make any changes in core structure.