Moved relevant parts of Format to API