Corrected way to get url link for creating a new record.

We discovered there was an error getting the $url value. We have fixed this here for when $params == null but it may also be required for when $params !== null.