fixed order by clause in chart endpoint