Make sure call rest apis return successfully rather than timing out

I just realised some of the calls to the rest apis on the server were timing out rather than running successfully. This fixes them to return success rather than 504.