Fixed issue when navigating to nonexistent pages

Previously, the pages would throw an exception when the
organization/location didn't exist, but now the issue is caught and the
user is redirected to the 404 page.