optimize rest unit tests