If Blender API document doesn't provide enough information of a function or class, what should we do? I ran into a fundamental problem in blender scripting. That is how to use the API document. 
When I ran into a function I don't know, basically, I will check the document to understand what that is. 
For example, some code employ 

layers = tree.nodes.new('CompositorNodeRLayers')


Then what is that layer used for? 
Ok, let's check the API doc. However, it only gives what members are in that class but never introduces what this class is used for eventually or give any examples. 
https://docs.blender.org/api/blender_python_api_2_78_1/bpy.types.CompositorNodeRLayers.html

After reading this doc, I still have no idea what is that or how to use that. 
What is the input of that node and what will be the output? 

So in such situation, what should we do? How to learn blender scripting by refering this API document? 

Thanks.
The API is for the programmatic options and things.  What is happening in that line of code is a new node is being created of the type 'R_LAYERS' in the Compositor. In short, it just makes a Render Layers node. To know more about the node, you would need to look in the manual, not the API. Render Layers Node