adding auth stuff. also, some style things. need to fix tests etc