Correct a timeout issue when posting command response.

We will need to review the promise syntax as it wasn't resolved using then. We were forced to use functions and manually resolve or reject the promise…