update database code with create, add, update and query based on sessions using sqlalchemy v0.9