Copper(II) and cobalt(II) dicarboxylate-based layered magnets: influence of π electron ligands on the long range magnetic ordering