improved structure, added API to README