api: fixed swap method.