Implemented Basic HTTP Authentication for the API. Added and updated unittests to take authentication into account. Cleaned up code base a little bit.