Atmospheric Chemistry of Secondary and Hybrid Atmospheres of Super Earths and Sub-Neptunes