setSource api change

Moved the setSource api from the context to the service