Create api.md

Pulled out API doc into separate file.