Refactored to use the new API version & jQuery deferreds.