Issue #254 resolved with tests

Fix for issue #254 Now search returns a "good" error message when accessing an out of bound page through the api.
Added tests to check that error is returned and that the error text is same as the one we provided.