Cleaned up get_messages(...) API