You should (read: must) not teach children alone. That opens you up for all sorts of bad allegations that could tarnish your name forever and end you on certain registers you cannot get off.
There should be at least one (or better two) other adults present in addition to the main instructor at all classes.
Usual disclaimer: I am not a lawyer nor do I play one on TV. I do teach children in my club so I am aware of the law in my local. Yours might vary… This is not legal advise.
Respect is earned, never given.
Kids/Teenagers are no different. You have to earn their respect. Thankfully, kids and teenagers are easier than adults in that respect.
At 40 you should not be training in a kids class so you should already be seen as an instructor by them all. Ideally, your main instructor should have you run warm up, cool downs, and teach segments of class while they are there. This makes the transition easier and you get respect reflected from the main instructor as you build your own. Also, they can police the class behind your back.
Kids are there to play. They want to have fun. Let them play games and have fun while trying to gloss over bad behaviour and be really vocal and supportive of good behaviour: positive reinforcement works best. Stop and shout only if they do something dangerous. Otherwise, keep your calm and cool just give your attention to those that do the correct thing. Kids do pick up on that.
Teenagers still like to play but want to be adults more. Let them. Give then room to take responsibilities for themselves. Ask them for help to get the kids under control. Again, positive reinforcement works best but teenagers are starting to see past that so you need to be a little more careful of big exaggerated praises.
Finally, show no fear: When I ask kids to do something there is no doubt in my mind, voice, and posture that it will happen. First sign of dissent gets put down fast in the most calm and gentle way possible! No violence obviously ☺. I find that just looking at a kid misbehaving and waiting for the to stop does the trick -- especially if the rest ask why nothing is happen. Of course, make sure you praise something worthy that said kid does later on. You want them to feel good even though you shouted at them five minutes ago. Then, let them all have a win: let them pick a game, a technique to practice, whatever.
As to command voice… Make sure you project your voice instead of shouting. Like any good tools, use sparingly it is great. Used too often and it becomes background noise.
[…] there was no significant problems with anyone, and work plan was followed.
Yeah, that's what we call a successful kids class. You did nothing wrong there. It's all good. If all your kids classes end up like that, you'll be a terrific teacher. Mike P in his answer has some great advise as to how to improve.
Things seemed to get out of track quickly and frequently.
Of course they do. Kids have no attention spam to speak of. That's normal. Letting them go off track for a bit then reigning them in is how you get them to actually do something.
TL:DR Your monsters are making you feel like you did not do well. You did.