API upgrade, part 2

API is now fully JSON based