Fix up client/lib/api.js