refactored view constructor a bit
support url args to set endpoint and stuff