pub fn package_error<E: ToString>(query: &mut Value, error: E) -> Value
helper to return errors as JSON response objects which include the original request along with the error message