do some work on the server side and precompile the swig template to make it faster