Feature/api revisited

Adds email parsing to http api controller - useful for remote piping
Change how api controllers exit - important for local piping 
Api error logging
Other related changes :-1: