adapted to Jersey 2.11