welcome to the site
Firstly,40 ppm is not dangerously high. It is about as high as you want to go but it's not as if you're putting a nitrate level above 100 ppm in every water change.
Obviously I don't know the circumstances of what they have done to your water so it's difficult to advise. Maybe you should give them a ring, tell them that you keep fish and ask them what they have done. Have you tested the ammonia, nitrite and pH? obviously when fish go off their food, this is a cause for concern, this and the fact that your fish are showing signs of stress, it could be a cause for concern.
I think you've got to find out what the water company have done, try and find out what they put in the water.about 20 years ago,A water company in Cornwall accidentally emptied 20 tonnes of aluminium sulphate into the water supply and caused a lot of health problems. Obviously this would probably have an adverse affect on any captive bred aquatic animals I would have thought.
If your ammonia and nitrites are okay and your nitrate is only 40 ppm then it's obviously something else that is causing your fish to act the way they are. Try and increase the amount of oxygen and see what happens. As for the green water,this is normally caused by algae. If your tap water a lot of phosphatesthen this could certainly increase the chances of high algae levels because accompanied by light, algae thrives very well. Try turning your tank lights off for most of the day. It might take a while for the water to clear up, normally water changes can help clear it. However, if it's a problem with the water that is causing the water to turn green, it may only make the problem worse.
just keep an eye on the situation for the next couple of days, see if things start getting better, if they don't, and get worse, we will try and address the problem further
Find out what they put in the water