refactored pending_listings controller to dry up code and improve error handling