Charge and magnetic excitations in hole- and electron-doped infinite layer cuprate superconductors