The 2nd example is an ebook. If the work is not directly available online or must be purchased, use "Available from," rather than "Retrieved from," and point readers to where they can find it. For books available in print form and electronic form, include the publish date in parentheses after the author's name.
A great free resource for more in-depth APA Style help is Purdue OWL's style guide.
Use information legally and ethically
To use information legally and ethically, you need to cite any information not originally created by you:
Zotero is a wonderful free software you can download to organize your sources, create your own library of articles, and easily create APA citations for papers and presentations.
Download / activate:
Zotero Standalone/Desktop version
Zotero Connectors (browser plugins for Chrome, Firefox, Safari)
Zotero for MS Word plugin
Create a Test folder (aka a Collection) in your Zotero library to add and practice creating entries
Practice adding items using the Zotero Connector (try adding from Google Scholar, the ProQuest database, or Libraries’ OneSearch box)
Right click on one or more items and choose "Create Bibliography from Item(s)," choose APA format for the Citation Style and "Copy to Clipboard" as the Output Method
You can also Make an appointment with Linds for help setting up Zotero.