set base_url to support versioning
fixed & renamed peer
moved all api code to apiserver.py
consolidated apiserver code; no need to spread 120 lines over six files