Amniocentesis is mainly done to check for genetic defects in the fetus.