added database backend code :)))) and some other..

random crap