copied reference implementation from:
https://github.com/thecodepath/ios_twitter.git