BZ-1054506, BZ-1057188 - Making history REST operations independent of the deployment (cherry picked from commit 71c77db030e70bec27c3e93f7e091b5cfe373f7b)