refactor datatable .. maybe undo later for API and JSON