add sorting to api v2
minor fix to console and test alerts