Setting up of models and api endpoints