fix alert api and tests
Merge branch 'hot-fix-alerts' into develop