added models and controller for api