extract api from core
Add default constructor for Sort
minor change on parameter handling