Moving relevant parts of Format to API