completed problem, user, and app classes
made db a global variable using "g"