wrapping API_BASE constant in function to better handle missing slashes

fixes #22