Code with test cases for model, view and requests