added JSON output so the library can act as a middle man for other services