Added Result Set Limit so that the number of items can be controlled.

Added result set limit, so that the most recent N number of entries can
be returned. Addtionally exposed error handling to C API.