def METHOD_NAME(
        self,
        session,
        target_server='',
        api_token='',
        message='',
        **kwargs):
    service, message, target_url = get_api_service_from_server(target_server, api_token)
    uri = '{}/jsonrpc/'.format(target_url)
    if not message and service and cherrypy.request.method == 'POST':
        from_departments = [(id, name) for id, name in sorted(service.dept.list().items(), key=lambda d: d[1])]
        for id, name in from_departments:
            from_department = service.dept.jobs(department_id=id)
            to_department = session.query(Department).filter_by(name=from_department['name']).first()
            if not to_department:
                to_department = _create_copy_department(from_department)
                session.add(to_department)
            _copy_department_roles(to_department, from_department)
        message = 'Successfully imported all departments and roles from {}'.format(uri)
        raise HTTPRedirect('import_shifts?target_server={}&api_token={}&message={}',
                           target_server, api_token, message)