Added sorting in table
Updated some API functions