add additional content-type test; isolate database interaction to increase modularity