test_file was not doing anything because format parameter not passed. Didn't raise error because 'format' is a built-in function
also moves id validation to core