Use ajax to fetch data in tables