Update client.js

Redefine method when updating endpoint