 void loop() {
   // handle slow cooker functions.
   slowcooker.loop();
-  
+
   // Get clients coming from server
   YunClient client = server.accept();
 

 * /arduino/start
 * /arduino/stop
 * /arduino/ping
 * /arduino/reset 
 * /arduino/state
 * /arduino/time/:val 
 * /arduino/temp/:val
 */
void handle_state(YunClient client);
void handle_ping(YunClient client);
void handle_start(YunClient client);
void handle_stop(YunClient client);
void handle_reset(YunClient client);
void handle_set_time(YunClient client);
void handle_set_temp(YunClient client);

static struct HttpCommand http_endpoints[] = {
  {"state",handle_state},
  {"ping",handle_ping},
  {"start",handle_start},
  {"stop",handle_stop},
  {"reset",handle_reset},
  {"time",handle_set_time},
  {"temp",handle_set_temp},
  {0,0}
};

SlowCooker slowcooker(HEATER_IO,TEMP_SENSOR_PIN,LID_SWITCH,&eventCallback);

// Listen on default port 5555, the webserver on the Yun
// will forward there all the HTTP requests for us.
YunServer server;

void setup() {
  
  Serial.begin(115200);
  Serial.println(F("Initializing..."));
  //setup slowcooker
  slowcooker.setup();
  
  Bridge.begin();
  
  // Listen for incoming connection only from localhost
  // (no one from the external network could connect)
  server.listenOnLocalhost();
  server.begin();
  
  sendEvent(EVENT_POWERED_ON);
  Serial.println(F("Starting main loop."));
}


struct HttpCommand {
  char* cmd;
  void (*func)(YunClient&);
};

void eventCallback(StatusEvent event);
