Fixed bug in read api method