Added null checks and converted JSON return type to ArratList