update backend.py,__init__.py and readme.rst changes include refactoring code and adding a document model class