     func logout(completion: () -> (Void)) {
         // Clear our session token and remove entries from the db
         self.sessionToken = nil
-        currentUserId = ""
+        currentUserId = nil
         let ad = UIApplication.sharedApplication().delegate as! AppDelegate!
         DatabaseUtils.clearDatabase(ad.managedObjectContext)
         completion()

                           "Development" :  "https://devel-api.tidepool.io"]
    
    // Session token, acquired on login and saved in NSUserDefaults
    var _sessionToken: String?
    var sessionToken: String? {
        set(newToken) {
            if ( newToken != nil ) {

    // MARK: Properties
    
    /** ID of the currently logged-in user, or nil if nobody is logged in */
    private var _currentUserId: String?
    var currentUserId: String? {
        get {
            if (_currentUserId == nil) {
                let ad = UIApplication.sharedApplication().delegate as! AppDelegate
                if let user = DatabaseUtils.getUser(ad.managedObjectContext) {
                    _currentUserId = user.username
                }
            }
            return _currentUserId
        }
        set {
            _currentUserId = newValue
        }
    }

    // MARK: - Constants
    
