quick API swap on jsonpp and handle invalid inputs more cleanly