added subscribe and unsubscribe APIs