get_queue function in api