adapted API to new DB layout (not tested)