fixed free memory calculation on api