You are only human. we're only designed to take so much bullshit until we need to flip a few tables (justifiably I might add). Sometimes it's the best thing to do, like in your case. I've had it happen to me a butt load of times where I just let every snide comment and "joke" insult slide and, honestly, it made it ten million times worse. They just did it more thinking the way they were treating me was fine even though it was actually offending/pissing me off. This in turn made me dislike them more and more and what started out as a great friendship turned into a hassle and a chore. To save a friendship in a situation like this, you have to voice how it makes you feel and if they are any kind of a friend they will accept it and try not do it any more. (It will probably happen again but hey, they're only human too, but a little reminder on how it makes you feel should make them acknowledge it more)..... I'm gonna stop now XD
Don't let it get you down man. Don't take bullshit from anyone because you don't deserve it <3