Use Option.apply instead of Some.apply in ClassToAPI

When dealing with Java APIs (Java reflection in case of ClassToAPI), one
should always go through Option.apply that performs null check.

This is supposed to fix NPE reported in #1617. We don't have a reproduction
so this is just an educated guess.
Merge pull request #1619 from gkossakowski/ClassToAPI-NPE

Use Option.apply instead of Some.apply in ClassToAPI