Cient side refactoring. Alert APIs added.