The Nitrogen Cycle in a nutshell: Ammonia is generated in fish waste and respiration and food waste in the tank. Ammonia is toxic to fish. In a "cycled" tank, there are "beneficial" bacteria that consume the harmful ammonia. Unfortunately, they produce nitrites which are also very toxic to your fish. Another group of beneficial bacteria consume the bad nitrites and produce nitrates. Nitrates are less toxic than ammonia and nitrites, but can cause failure to thrive, shortened life span, hole in the head disease and other problems. In a cycled tank, there is enough beneficial bacteria to convert all the ammonia and all the nitrites. They will produce nitrates. When you test the water, there should never be any ammonia or nitrite present. There will be nitrates which you should remove by doing water changes. The beneficial bacteria resides predominately in your filter media, so when cleaning your filters, you should just rinse the media in tank water, rather in in tap water which has chlorine or chloramine in it. Doing so could kill off the beneficial bacteria that your tank needs.
The fact that your tank was cloudy sounds very suspicious of a bacterial bloom that frequently occurs in an uncycled tank which has ammonia and/or nitrites present. Test the tank water for ammonia, nitrite and nitrates. High ammonia and nitrites are very harmful to fish.