Fix api location new to strip unit properly. Allow for unit to be null.