API: Query latest version

#1469; I'm not quite sure if there is a more elegant way but it does what it's supposed to do :-)