Fixed endpoints problem

...endpoint regexp to match an endpoint with or without -api for backwards compatibility