cleaning up switch api and adding docs