fixes #3515 - API handles not found objects with 404
fixes #2810 - more restful API v2 JSON responses in puppetclasses
NOTE: breaking changes to API v2 api/lookup_keys does not exist, replaced by api/smart_variables and api/smart_class_parameters