api and api-entry sorting by id addded