fix results. move gems into root
refactor authorization handling