API: accept -1 for layout