Constraints and conserved quantities of the Kadomtsev-Petviashvili equations