Add service provider api to get instances of various services

Added a unit test. Existing tests are passing. @sumashivaprasad @Amareshwari  pls review.
Updated comment.