adding pagination and sort_table_by
fixing error in validator
adding the sort_table_by macro