Remember that diplomacy is different in this game than it was in Civ IV... the main difference is that they are in it to win the game, rather than be braindead obstacles in your way. The best way to keep enemies from being too mad at you and to prevent them from backstabbing you is to make yourself valuable to them. Trade them some resources (even if it is a gift) if you can spare it, start research agreements, stand between them and a warlike nation, don't get friendly with too many city states, don't get threatening with your units and DO NOT be weak and unable to defend yourself. Basically you want to make it so a war with you would cost them a lot more than it would benefit them.
Trust me, it is very rational.