On the palette index of a graph: the case of trees