refactored existing stuff. added own resourcehandler for the database