Refactoring in response to feedback on #5754

- Adding REST tests to validate fix