Updating javascript endpoint