APA prefers that DOIs be used whenever available. Here are some top tips for DOIs and URLs. You can find more details from APA.
Sometimes sources do not have all of the basic elements. When this happens you omit the missing element and continue with the next one. For instance, if no author is listed you start with the title.
APA has a great chart to show you what to do in common scenarios.