Moved to APIv2. Fixed some bugs.