# Buggy code
def pull_data(self) -> Dict:
    """Pulls data from the server and returns the response dict

    Raises RemoteError if there are problems reaching the server or if
    there is an error returned by the server
    """
    signature, data = self.sign("get_saved_data")
    self.session.headers.update(
        {
            "API-SIGN": base64.b64encode(signature.digest()),  # type: ignore
        }
    )

    try:
        response = self.session.get(
            self.uri + "get_saved_data",
            data=data,
            timeout=ROTKEHLCHEN_SERVER_TIMEOUT,
        )
    except requests.exceptions.ConnectionError:
        raise RemoteError("Could not connect to rotki server")

    return _process_dict_response(response)


# Traceback (AssertionError)
[07/10/2020 10:06:45 CEST] ERROR rotkehlchen.api.server: Exception on /api/1/users [PUT]
Traceback (most recent call last):
File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask_restful/__init__.py", line 458, in wrapper
resp = resource(*args, **kwargs)
File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, **kwargs)
File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/flask_restful/__init__.py", line 573, in dispatch_request
resp = meth(*args, **kwargs)
File "/home/lefteris/.virtualenvs/rotkipy37/lib/python3.7/site-packages/webargs/core.py", line 366, in wrapper
return func(*args, **kwargs)
File "/home/lefteris/w/rotkehlchen/rotkehlchen/api/v1/resources.py", line 511, in put
initial_settings=initial_settings,
File "/home/lefteris/w/rotkehlchen/rotkehlchen/api/rest.py", line 812, in create_new_user
initial_settings=initial_settings,
File "/home/lefteris/w/rotkehlchen/rotkehlchen/rotkehlchen.py", line 194, in unlock_user
sync_approval=sync_approval,
File "/home/lefteris/w/rotkehlchen/rotkehlchen/premium/sync.py", line 267, in try_premium_at_start
if self._sync_data_from_server_and_replace_local():
File "/home/lefteris/w/rotkehlchen/rotkehlchen/premium/sync.py", line 128, in _sync_data_from_server_and_replace_local
self.data.decompress_and_decrypt_db(self.password, result['data'])
File "/home/lefteris/w/rotkehlchen/rotkehlchen/data_handler.py", line 229, in decompress_and_decrypt_db
decrypted_data = decrypt(password.encode(), encrypted_data)
File "/home/lefteris/w/rotkehlchen/rotkehlchen/crypto.py", line 34, in decrypt
assert isinstance(given_source, str), 'source should be given in string'
AssertionError: source should be given in string
[07/10/2020 10:06:45 CEST] INFO rotkehlchen.api.server.pywsgi: 127.0.0.1 - - "PUT /api/1/users HTTP/1.1" 500 216 0.627664

# Fixed code
def pull_data(self) -> Dict:
    """Pulls data from the server and returns the response dict

    Returns None if there is no DB saved in the server.

    Raises RemoteError if there are problems reaching the server or if
    there is an error returned by the server
    """
    signature, data = self.sign("get_saved_data")
    self.session.headers.update(
        {
            "API-SIGN": base64.b64encode(signature.digest()),  # type: ignore
        }
    )

    try:
        response = self.session.get(
            self.uri + "get_saved_data",
            data=data,
            timeout=ROTKEHLCHEN_SERVER_TIMEOUT,
        )
    except requests.exceptions.ConnectionError:
        raise RemoteError("Could not connect to rotki server")

    return _process_dict_response(response)