In almost everything that i have seen till now,bad guys always get punished at the end but i want the opposite bc real life doesnt work that way...It also could be that main leads have commited some kind of crime and it never gets exposed

Hmm that's a hard one.....maybe Secret? I mean, their crimes and wrong-doings are exposed, but there aren't really legal consequences (I'm thinking of one character in particular).

It's a really suspenseful drama, I enjoyed it a lot. And the "bad" characters are featured quite heavily and consistently. 
BORDER
Holyland
...maybe?

And I'd also like to recommend you Zeni Geba and Gap Dong because for the most part they get away with their crimes and even when they are exposed at the very end, they don't really get punished, but have more of a conflicted mind and they kind of punish themselves
Joker - the criminals are not punished by law
Kurokouchi

that was harder than I thought

+ Kagi no Kakatta Heya - the protag is a shady one
and maybe you'll like Akutou with crooked cops everywhere and coverups
Hmmm  ... I Remember You (Hello Monster)? the main bad guy we were wondering how will he get killed or arrested just ran away in the end.
Ah and The Princess' Man, I don't really remember the plot very well but the king I was expecting to get killed awfully didn't get what he deserved in the end..
Empress Ki: All the good and bad guys ended up dying .. u might like this one :P
Thanks everyone for their recommendations,i will check them out...I have already watched N No Tame Ni and its one of my favorites...I Remember You is on my PTW list for a while so maybe i should start watching it
Byakuyako - though I can't remember if they get away with everything.