move some instance functions into class methods
remove obseleted code
add authorization headers to add repository function
minor header formatting change