I really don't understand where your nitrates are coming from either. If you have changed out all your water, then you should have close to zero nitrates. Unless you are adding a chemical in that we are not aware of. There are only two ways to get rid of nitrates. One is to do a water change and the other is to have live plants that use up the nitrogen. If these methods are not getting rid of enough nitrates, then there must be a source of nitrates somewhere. Usually, in an established tank, this is leftover food and/or fish waste on the bottom that isn't getting gravel vacuumed well enough, or it is a dirty/clogged filter cartridge. Sometimes, it can be a dead fish that got stuck in a decoration or something that is decaying. (this last one however often causes ammonia or nitrites to spike too). In your tank, it would seem that none of these are the culprits. Maybe, part of your filter got clogged with some ammonia? Perhaps if you rinse your filter in dechlorinated water (won't hurt any BB that is built up, but could get rid of anything that might be a problem), and do another water change, your nitrate might come down. Dunno. But, your tank is not turning the 3-4ppm nitrate into 20-40ppm nitrate. It doesn't work that way. There is another source of nitrates somewhere. Where, I don't know.
Emily