fixes #3515 - API handles not found objects with 404

(cherry picked from commit 46338cd73c542ecc3aa045b45e831434792c710e)
Fixes #4022: Make api puppetrun a PUT for REST standards

(cherry picked from commit bc11c17bcc66fbec3a71be920efa4de32d508ecb)
fixes #2231 - hostgroup deletion is restricted to hostgroups without children

(cherry picked from commit 8c68024ac619121312680ee8afc467857155e71d)
Bump copyright, remove spurious file

(cherry picked from commit 21a51525360341356b11d17259506011f42434ae)
fixes #3983 - added trends:clean to cron

(cherry picked from commit cf4861dd7a44e3264c81ae5b98bb01caf298ab8f)
fixes #3940 - extlogout page layout fixed

(cherry picked from commit b4b12197e4ffecfe97b14f3ecd5631b26ebd9489)
fixes #3867 - Wrong Compute Resource type shown on overview

(cherry picked from commit 2ebd2f227aef16da62c7884065bb9b47a846c9a3)
fixes #4139 - fixed quiet flag in foreman-debug

(cherry picked from commit d03f4e530191434b2db4bc78841c3c67ba5c88ff)
fixes #4132 - helper select_f missing option for :multiple => true to increase width

(cherry picked from commit 52667febe83f247b9a166c233a9bde1f62f72607)
fixes #3998 - API v2 error on /api/compute_resources, missing gce.json.rabl

(cherry picked from commit 9926d4d3f87e439d2eaa36f5d54b07d71c57c3fe)
fixes #4023 - API v2 - compute resources partials should should attribute alias names and not database column names

(cherry picked from commit 8a0ffcfaa900079d628253ee7f9de2feec182914)
fixes #3760 - API v2 define metadata @total for each controller

(cherry picked from commit 6f9438866488180e196ff18e1372cf0773afe7b9)

Conflicts:
	foreman.spec
fixes #359 - hostname spoofing for unattended installation templates

(cherry picked from commit 5b70f0e0232bff3e580923f485bc0bd1816d9279)
fixes #3920 - prevent 500 ScopedSearch errors on the API, raise UI errors correctly

(cherry picked from commit f9bc5a8e5934aac9bd8d5488f84717d33e359501)
fixes #3925 - create apipie param_groups for API v2 to DRY documentation

(cherry picked from commit 2be84f3d773e74b5cc37841284ec216996fd0b51)
fixes #3826: no more sql errors when trying to search for environments (also domains, operatingsystems, and models)

(cherry picked from commit 145db8634df9fbc3ffb51b80093809c5aecd0f6e)
fixes #4115 - added missing LICENSE file

(cherry picked from commit 41e9d14b228bda3a4c5f0dde5b7221fd3806e890)
fixes #3828 - set language locale for API messages and error responses

(cherry picked from commit 5a864bedb5d9bbbb68788169aa0f0396a312ac16)
fixes #3955 - added param_true? and snippet_if_exist template methods

(cherry picked from commit 3701a8d1c6d698ea8c57321eed2f87c74bd57728)
fixes #4152 - fix syntax error in _form.html.erb for hosts and hostgroups

(cherry picked from commit 378c65e5af8ff131ae1701c78934d6bbd0a055e9)