Refactor toggle endpoints with named routes