fix alert api and tests