Api improvements to support http get, non-ajax requests and better error handling.