Added ajax support to database errors (suppress HTML when called by ajax)