Added entire alerts logic to backend. Finally. Now to front end.