Some helpers for making API calls in Swift