[api] return null if no url is passed in rather than throwing