changing urls from hardcoded to reverse urls

This is to support having the applcation under a path
other than / on a virtual host.