Change api end point urls to use json end points. Add error message for ...

...api timeouts