update to latest pubnub api