We just released a new API to make it easier to generate short URLs.
Check it out