cleans up api