Updated classes and fixed some bugs.

TODO: Need to work on a new way to return information to rails.