restructured database access, fixed incurring errors
fixed more incurring errors
fixed startpage