Fixing potential NPE and reveresed url constants