Fixed a bug in .api() method