Added tests. Added workarounds for API bugs. Added calls.