Refactor API package to remove references to gwt classes.