Bug 21786: Make balance and credits endpoints handle library_id