Model API

Added a model API.