Added status attribute, onswarmstatechange event, and error constatns