Added debug mode for the toggle api call