attempt at simplifying db/http interaction