Extended getData function

Added conditions & page parameters