Add interfaces and functions. Bugfix code and README.