moved doDatabaseActions from model to controller