Writing out api, in progress