Updated database calls to use ss3 ORM calls