added sorting for /nodes route