Enable API Stubbing.

I wrote this to help myself understand the 2.0 sdk. Not sure if this aligns with what you were planning to do for stubbing but thought I'd throw it out there. If you have something more elegant planned would be happy to contribute/test.