Refactor TestRestApi