Moved code into ResourceRoutes. CR #2177901 and issue #2145041 .