Fixed breaking bug in server.js, it now saves json correctly