Changed queries to query off the view, query for ranged dates, added pagination