supporting custom 500 responses

- apiSend500 and pagesSend500 functions can be supplied via the config
- they get called when a server error occurs
- if not defined a default send 500 function is used
- this behavior was tested and documentation updated