Still need to flesh out the writing part of the API. init functions are making it very messy at the moment.