The ruling Justice and Development Party , which has made EU hopes a policy centerpiece , suffered a rebuke in municipal elections last week , seeing its margin of victory shrink compared with national elections in 2007 .