Use built-in JSON encoder
Create process for mongo connection to be shared