store the alarm correctly (but not so good)

- add a flush method to force the cache synchronization, which is
  not what is not right. should be automatical along the lifecycle
  of the view.
- anyway, if the cache holds an alarm already, just take the id of
  it and modify it. this add logic is fine.