added subscribe and unsubscribe to API