replace endpoints