make db pull work correctly
make applications with no refs not show the ref link at all

it was linking to the profile id as reference id which led to a
reference for someone else