create model with function to retrieve records