Added grant API interface to 3.4 library

Adapted from @stephenlb 's gist here:

https://gist.github.com/stephenlb/8483690