Added APIs for: init, setmotor, setswitch