added unsubscribe api and fixed callbacks without rpc function