a ton of untested crazy code with a hope of one day being a real apip auth system