Implementing getRoutes ajax call