Add basic auth security for api
Basic auth using mongodb storage for /api urls
Fix exception when invalid string for BSONObjectID is provided
Refactor api classes