jquery bug fixes / refactoring jquery + erb/routes

This section only queries for the top 20 in descending order. Even though we use #all method, it does not store them all as objects first, rather, it takes the full query of chained methods and performs the calls in the DB.