Completed function to generate final response
Used http parser code along with given serverFork skeleton