Additional description of v4 api and how to use it.

This request updates the api.md documentation to include examples of using the v4 api, and the conditions that must hold in order for a request to work.