Modified to keep up with API changes, added a pre fetch event.