Cleanup api and add bulk email support.