+ try/catch to JSON.encode of the response + httpserver attribute in main class