Fixed restler api use, taking care of async mode