Move Class Selected to Success

Make sure that the ajax call succeeds before setting the selected class.