Extending Exception: avoiding code duplication
Naming:


ResponseParser doesn't actually parse a response. Parsing a response would mean taking some response object and extracting data from it. This class does the opposite - given some data, it generates HTTP response.


Separation of concerns:


Exception classes are aware of how to output themselves as HTTP response. Would be better to structure things the other way around: passing the exception object to ResponseParser that generates the HTTP response.


Side-effects:


parseResponse() outputs HTTP headers and returns JSON. It's confusing when function has a return value and it also generates some output. I would it to expect to also output the JSON as the response, or returning both headers data and JSON without causing any side-effects.