Function to load a single bean by id.