#225: Properly return JSON server object to javascript

Resolves #225.