Add model api
Initial implementation of the model api
Change license to LGPL v2.1