I have an api endpoint called status. Which should be used like this:

```
status/ohio/columbus
status/nebraska/fremont
status/ohio/columbus/police
status/nebraska/fremont/fire

```

The state and city paths are mandatory but the department is not. 

I'd like to have a function which updates a callback with the return value. Is the following function reasonable or confusing? Should I have multiple functions instead - getStatus and getStatusForDepartment?

```
function getStatus(state, city, department, callback) 
{
    let status = "status/"+state+"/"+city
    if(typeof department != "function"){
        status = status+"/"+ department
    }else{
        callback = department
    }
    ...
}

```