updatin jsapi functionality