first attempt at foldering implementation, needs a lotttt of refactoring and clean up
some authentication fixes