Changed the Javascript API

Changed the Javascript API.
Passing a JSON object to addAlarm with all data needed.