Upgrade to apm 0.65

Closes #2516