Leogtr is quite correct, a 20 litre (5 gallon) tank is much, much too small for all those fish. But you're in good company, most of us went through this. My first aquarium was a 5g and I shudder to think of all the fish i had. No wonder they didn't live long.
Nitrates at 500 is very serious. No fish in nature is exposed to nitrates at all (unless through an environmental disaster or something), so while it can be said that nitrates are generally not toxic (as are ammonia and nitrite), high levels must take its toll on the fish's metabolism and physiology. Nitrate should always be below 20ppm.
Please consider re-homing most of the fish, or acquiring a larger tank [this is always fun and exciting
]. The largest you can manage in terms of space and cost. No matter what tank we buy, it is usually too small for all we want in it. And as leogtr said, water stability is much easier and reliable the larger the volume.
In the meantime, frequent partial water changes of 50% of the tank 2 or 3 times a week will help; I would suggest daily, but you don't want to suddenly shift the parameters too drastically. Lucky you have live plants, they do an incredible job in water quality, but they have a limit.
The best effective way to clean gravel is with a water changer siphon. Clean the areas you can see; leave the areas where the plants are. Use a good water conditioner.
What is this "general tonic?" These products are usually more harm than good, in spite of what the manufacturer may claim. Anything that messes with the natural biological processes in an aquarium are risky. I may have more when I know what it is.
Good luck. And if you have further questions (your probably will
), ask away. Everyone here is very eager to help fellow aquarists.
And welcome to Tropical Fish Keeping forum.