Flask db used instead of sqlalchemy db. All related imports removed and replaced with calls to flask-sqlalchemy. Model base classes changed to db.Model which is declerative as well. All these changes triggered to support paging, sqlalchemy queries do not have pagination. Related to  #1