Your question gives very little information. In fact, there is not enough information to give a thoughtful reply, so I'll ask a few questions and make a few general observations.
Were you and the children's father together during their formative years? How did you allow him to treat you?
Did you have a close relationship with your own parents? Did your children observe how you and your parents interacted with each other?
In many cases, it is not so much what you did as what you communicated. If you said one thing, yet did another, it is likely that your children picked up on the behavior instead of the words.
Also, what type of personality were you?
Were you the put-upon type who always suffered yet seldom complained?
Your children will treat you how you allow them to treat you.
Rather than allowing them to treat you "like crap," take a stand and firmly but nicely inform them that you will no longer accept that kind of behavior. Decide ahead of time how you will respond the next time they do so (choose a consequence). Then, let them know your plan and be prepared to follow through with it.
Remember, no one can take advantage of you without your permission.