Promisify last http request logic, tidy up database get