removed n passing and fixed bug

Removed passing of the n object throughout entire code base and added code to remove a bug occuring when the API has issues and returns an unparseable string.