refactor code and copy mock_response.json to mock_response.txt