Fix model id retrieving for route paths