Refactored
- Removed for writing html response to temporary file
- Generalized functions to use a file buffer instead of
  having to read from file