updated server call to a promise
added error message to promise