cleanup of the api