update api, add allocate swap cmd