Adding request and response type in Rest api and improved rest service to handle callback