fix api exceptions, add cache, fix js problem