Fix pm write in API