Cleanup code a little bit

- Use OCP\Response constants instead of the HTTP error code
- Use checkAppEnabled() instead of OC_App::isEnabled with an if statement
- Remove uneeded variable $baseURL
- Rename $isvalid to $isValid
Add missing \
Merge branch 'master' into cleanup-list-code

Conflicts:
	apps/files_sharing/ajax/list.php
Merge pull request #8444 from owncloud/cleanup-list-code

Cleanup code of files_sharing/ajax/ a little bit