Needs db query changes and db error reporting.