Fixed trailing slash in URL

Added regular expression to remove trailing slash if included in URL. Api::__construct