updated with new apiwriter