switched to production api; fixed several bugs