Updated error handler functions, to send erros according to content type
Removed deprecated functions of body parser and express sessions