javascript performance improvements.
Fixed error message when trying to read error.
Fixed Access control header configuration for nginx
Wrapped code used to process incoming request in a try catch block.