jquery and ajax cleanup and RESTful routes refactoring