working api with db, untweaked and undocumented