Assuming you want to leave the apartment and not stay, what you do is use the threat of filing a complaint with the city for failure to repair and make livable the unit as leverage to get you out of your lease. What you seek is a written mutual termination, without penalty. That means you owe nothing other than rent for the current month, nor owe for damages (assuming you have not caused any). The likely and best scenario is the security they hold will be used towards current rent. You might be able to negotiate for waiver of current rent, but that's a stretch if they hold a deposit. This is not so much about right or wrong at this point, more about what the resolution is going to look like.
But remember, you need the agreement in writing and you need to get it before you file a complaint. Once you file, you lose that leverage because the damage to the landlord (meaning they now have the city in their business) is already done.
If they do not agree, file the complaint and hold back rent until the problem is fixed.
Sorry you are going through this. Your landlord sucks. They are either a bad person in the first place, or have gotten in over their head - in either case they suck, and so do the punks they have running around fixing things.