Added API functionality

No need to export this one. I think there's a couple of other ones that are only used within this file.