implement api #2

1. add minimal buildout for installation
2. implement api
3. modify setup.py