General improvement & http status handling

Improved the following
- Commenting
- Error Handling
Add the following:
- HTTP response codes & headers
- Content types: JSON/HTML