Initial Commit of API

Initial commit of basic API
Add exit on connection refusal and remove debug print

Ensure exits at creation time if connection is refused
Remove debug print outs