handling minor cleanup to api