use a function map to handle specific api paths