db api design

You suggested this kind of sorting..