Husband troubles.

I really need some insight from people that don't know our current situation. 
Myself and my husband have had our fair share of ups and downs. But no matter what, I am continuously facing him giving me attitude and being disrespectful to me. He is fine for a while, then he just starts again. I KNOW I deserve to be treated better, and I don't treat him with that disrespect. Ever. It's embarrassing the way he does it not only when we are alone, but in front of our friends and family too. I've screwed up, in the past. I kissed one of our good friends And I've caught myself texting my ex from time to time, but I'm such an honest person that I dot keep these things from him. We've worked past these problems for the most part, but the respect (or lack of) has been apparent since I got pregnant with our first child. We had only been dating for 9 months when I got pregnant, and were married a little after 2 years of dating. We have been married for almost 4 years now, but sadly the disrespect is still an extreme issue. We have 2 children now, and I feel like I am only here because of them. I'm tore and tired. Please give me some insight.