added subscribe and unsubscribe apis