The properties of neutral and ionized atomic oxygen and their influence on the upper atmosphere