made db->obj function recursive so that it can return full json