finishes the type API