Fixed broken tests, moved spec part of format to API