added base_url option

probably wont use base_url though instead just assume all links are relative to
the api path (so i removed the default leading slash from the paths) so all
knowledge of the /api path is outside the api. Also refactored the json resource
to base, just to be consistent.