added api documentation, closes #42