# Functions
ErrorJSON makes json and respond with error
If err is an instance of httpErr, then `httpStatusCode`, `details` and `errCode` are ignored and those fields are pass from httpErr instance.
New5XXHttpErr returns http error that would be returned to client with 500 http status code and msg string ad details.