improve endpoint options

works with NodeJS now