updated models to new schema
Fixed and updated queries