Define interface

This adds the definition of the public interface. Comments welcome!

@neithernut 
This is contradictory to what is written in the warning, you should also specify that error codes are returned here