   now = rtc.now(); // update the now
 
   // initialise the rest api  
-  rest.function("setAlarm", setAlarm);
+  rest.function("setAlarm", restSetAlarm);
   rest.set_id("001");
   rest.set_name("SmartAlarm");
 

 * REST compatible function for setting an alarm
 * yyyy-mm-dd_hh:mm:ss
 */
int setAlarm(String command) {
  Serial.println(command);
  // delimiters
  command[4] = 0; command[7] = 0; command[10] = 0;

  if (!digitalRead(KEY_CANCEL)) {
    // cancel the alarm
    while(!digitalRead(KEY_CANCEL)); // debounce
    Serial.println("Cancelled via button!");
    cancel();
  } else if (!setting && !digitalRead(KEY_OK)) {
    // enter the setting mode
    while(!digitalRead(KEY_OK)); // debouncing
