Defining model methods and use the API decorators