js and endpoints