Add parameters to initialize the CORS filter properly to allow the following methods:
 -GET
 -PUT
 -POST
 -HEAD
 -DELETE
 -OPTIONS

And the following request headers
 -Accept
 -Origin
 -Content-Type
Fix NPE when the result set was not null, but the actual JSON object is.