Update index.js

Fixed 'get' to account for error,result being returned from findOne MongoDB call