Refactor get requests in RestTest

Reduce the amount of copypasta code