Use file_put_contents in API tests