Moved db connection code into a function
small auth bug fix
added the sel db name back
Created unit tests for every endpoint except for basic auth stuff. All tests assert false for now