Cannot call method 'get_categories' of undefined

I'm working with a node module from Semantics3. My code is located in a file called search.js that is located in my routes folder. The code appears below. Somehow I am not referencing the module correctly because I'm getting an undefined-method error on sem3.categories.get_categories. However this same code works when I move it to the app.js folder. Am I correct in my determination that I am referencing the node module incorrectly? And if so, what is the correct way to reference a module from a file other than app.js?

var express = require('express');
var router = express.Router();
var api_key = 'my key';
var api_secret = 'my secret';
var sem3 = require('semantics3-node')(api_key,api_secret);

/* GET search results. */
router.get('/', function(req, res) {
    // Build the query
sem3.products.categories_field( "cat_id", 4992 );

// Make the query
sem3.categories.get_categories(
   function(err, categories) {
      if (err) {
         console.log("Couldn't execute query: get_categories");
         return;
      }
    // View the results of the query
    console.log( "Results of query:\n" + JSON.stringify( categories ) );
    res.send(JSON.stringify(categories));

   }
);




});

module.exports = router;

This blog article may help - http://www.bennadel.com/blog/2169-where-does-node-js-and-require-look-for-modules.htm

I haven't used Node recently, but it must have something to do with relative/absolute paths. I think it is searching for a node_modules folder in your 'routes' subdirectory. You may have to define the specific relative directory path from 'routes' to node_modules sem3.

Instead of

var sem3 = require('semantics3-node')(api_key,api_secret);

Do something like

var sem3 = require('[insert relative path ie. ../modules/lib/semantics3-node]')(api_key,api_secret);