Fixed NPE errors, added new tests for the APIReader class.