Pulled out server side database commands, and returned to db from front end just for this commit.