More login work, added auth api that uses json web tokens.