fix api path in javascript