<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def login_with_api_token(api_token):
 """Login to Todoist using a user's api token. .. note:: It is up to you to obtain the api token. :param api_token: A Todoist user's api token. :type api_token: str :return: The Todoist user. :rtype: :class:`pytodoist.todoist.User` John Doe """

    response = API.sync(api_token, '*', '["user"]')
    _fail_if_contains_errors(response)
    user_json = response.json()['user']
    # Required as sync doesn't return the api_token.
    user_json['api_token'] = user_json['token']
    return User(user_json)