Added possibility to sort and to select some of the items in the database (basic where and ordering clauses)