Refactor ajax queries, to follow new routes.