Replaced str_to_upper so it returns a char * instead.
Refactored full request parser for simplicity.