Started re-implementing the API, rather than trying to wrap it.